While function must have correct input in order to continue
显示 更早的评论
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! :)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!