Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to tell MATLAB to go to the next replication i

1 次查看(过去 30 天)
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.

回答(1 个)

David Fletcher
David Fletcher 2018-3-10
if WHATEVER=false
break;
end
  4 个评论
Mikie
Mikie 2018-3-11
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 2018-3-11
counter = 0;
all_p = sym([]);
for i = 1 : 100
...
if isempty(p); continue; end
counter = counter + 1;
all_p(counter) = p;
end

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by