how to declare two variables together in the for loop

1 回表示 (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 1 月 6 日
コメント済み: Rik 2018 年 1 月 6 日
how to declare two variables together in the for loop
  1 件のコメント
Rik
Rik 2018 年 1 月 6 日
It works the exact same way as outside a loop. The only thing to keep in mind is that the loop is repeated, so your assignment might be overwritten.

サインインしてコメントする。

回答 (1 件)

Stephen23
Stephen23 2018 年 1 月 6 日
R = 1:4;
C = 2:5;
for k = 1:numel(C)
r = R(k);
c = C(k);
...
end

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by