Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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?

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 10 Jun. 2016
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

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by