While function must have correct input in order to continue
Afficher commentaires plus anciens
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! :)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!