Hi,,is there anyone who could tell me how do I use a loop control statement in matlab? or how do I use iterative loops in matlab?
1 次查看(过去 30 天)
显示 更早的评论
how do I execute and control a statement for several time? In C++,flag=true/false,could be used.How do I do that in Matlab?
0 个评论
采纳的回答
Geoff Hayes
2016-6-10
nafila - see loop control statements for some examples on how to use for or while loops. Using your C++ example, you could do something like
flag = true;
while flag
% do some work
if someConditionMet
flag = false;
end
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 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!