using a loop within a loop in matlab

1 回表示 (過去 30 日間)
ektor
ektor 2020 年 5 月 29 日
コメント済み: Adam Danz 2020 年 5 月 29 日
Dear all,
I have this problem
T=1000
for ii=1:T
for t=ii:T
'here a have a function that depends on t'
end
end
If I try to run this code I get an error that 'ii' is not recognised within the second loop. Is there a way to avoid this?
Best
  2 件のコメント
Robin Kirsch
Robin Kirsch 2020 年 5 月 29 日
If i copy paste your code it works, i dont get the error
Adam Danz
Adam Danz 2020 年 5 月 29 日
Please provide the entire copy-pasted error message.
It may be helpful to know what release of matlab you're using.

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

回答 (0 件)

カテゴリ

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