While function must have correct input in order to continue
Mostrar comentarios más antiguos
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! :)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!