How to save iteration values as array if for loop- for t=0:0.5:3?
1 回表示 (過去 30 日間)
古いコメントを表示
Dear Experts, I need to save M(t) iteration values as array if for loop as follows:
for t=0:0.5:3
M(t)=a2.*(exp(-(t./T1)))
end
This gives error as 'Subscript indices must either be real positive integers or logicals'.
Please help.
0 件のコメント
採用された回答
kowshik Thopalli
2017 年 8 月 9 日
Use another index value outside the loop and keep updating it inside the loop such as
index=1
for t=0:0.5:3
M(index) = whatever you have
index=index+1
end
その他の回答 (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!