Storing for loop calculations

3 ビュー (過去 30 日間)
Eric
Eric 2014 年 5 月 13 日
回答済み: Image Analyst 2014 年 5 月 14 日
I am interested in storing all the results of a for loop in separate matrices. How do I write a function such that Matlab will store the matrix result of, say, the ith iteration as [Ai]?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 5 月 14 日
for k = 1 : whatever
A(k) = blahblahFooBar;
end
It's recommended to use variables other than i and j (imaginary variables) as loop indexes.

カテゴリ

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