Basic loop syntax in MATLAB: for k=1:n
20 ビュー (過去 30 日間)
古いコメントを表示
What does it mean
for k=1:n
2 件のコメント
Walter Roberson
2021 年 3 月 29 日
It is as described in the responses rom Sean and I, with n being 3.
回答 (2 件)
Sean de Wolski
2011 年 1 月 28 日
it means that everything between that line
k = 1:n
and
end
will be evaluated with k = every integer between 1 and n.
doc for
for more information
0 件のコメント
Walter Roberson
2011 年 1 月 28 日
(Adjusting Sean's answer):
it means that everything between that line
k = 1:n
and
end
will be evaluated with k = every integer starting at 1 and not exceeding n; no iterations will be done at all if n < 1
doc for
for more information
4 件のコメント
Matt Fig
2011 年 1 月 28 日
Jan, how do you remember these things! There are obviously no angry armadillos bouncing around in your head.
Walter Roberson
2021 年 3 月 29 日
(The link mentioned by Jan moved to https://groups.google.com/g/comp.soft-sys.matlab/c/VHVkpxJoKMA/m/lMVgXwAYV-wJ )
参考
カテゴリ
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!