Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to tell MATLAB to go to the next replication i

2 Ansichten (letzte 30 Tage)
Mikie
Mikie am 10 Mär. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi, I am new for MATLAB. Please, help me.
for i = 1:100
....
while .....
if WHATEVER
end
end
end
If WHATEVER is not true, how can I tell MATLAB to skip to the next replication i ? Please help me. Thank you so much.

Antworten (1)

David Fletcher
David Fletcher am 10 Mär. 2018
if WHATEVER=false
break;
end
  4 Kommentare
Mikie
Mikie am 11 Mär. 2018
Thank you so much. Also, how can I tell MATLAB not to keep "Empty sym: 0-by-1" to p? Skip it and collect only scalar p.
Walter Roberson
Walter Roberson am 11 Mär. 2018
counter = 0;
all_p = sym([]);
for i = 1 : 100
...
if isempty(p); continue; end
counter = counter + 1;
all_p(counter) = p;
end

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by