From for to While loop
Ältere Kommentare anzeigen
Hello! Could someone please help me to convert this for loop to a while loop?
Akzeptierte Antwort
Weitere Antworten (1)
Steve Eddins
am 24 Nov. 2020
Here is one way to convert a typical MATLAB for loop to a while loop:
for i = 1:N
...
end
i = 1;
while i <= N
...
i = i+1;
end
2 Kommentare
Steve Eddins
am 24 Nov. 2020
Can you show us specifically what you tried?
Rik
am 24 Nov. 2020
Now deleted comment:
I tried that, but I couldn't get the whole matrix to show.
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!