While function must have correct input in order to continue
Show older comments
Hello everyone
I have a function that i need the user to enter the right statistic into. It's a part of a Main script where you first choose which function to use.
function data = calculate(data,option)
while true
if strmcp(option, '......')
condition
elseif strmcp(option, '......')
condition
else
** ENTER INPUT AGAIN AND EXECUTE CONDITION **
end
end
So i need it to go back to the while loop, and look for a correct input in the function, and then calculate the option choosen.
I've tried using ...... = input('State correct input: ') but it doesn't work.
I hope some of you can help me.
Thanks in advance! :)
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!