Skipping part of an index in a for-loop
5 ビュー (過去 30 日間)
古いコメントを表示
I have a set of data and a for-loop, for instance:
d(1) = 1;
d(2) = 2;
d(3) = 3;
for j= [1 3];
g = d(3)./(d + d(3));
end;
I would like the for-loop to skip one of the numbers in the index (for instance, 2). How can I go about coding this up?
0 件のコメント
回答 (1 件)
dpb
2016 年 7 月 31 日
nDont=2;
for j...
if j==nDont, continue, end
...
doc continue % for details
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!