How to save output of double loop as a matrix?

1 回表示 (過去 30 日間)
Ammy
Ammy 2021 年 9 月 19 日
コメント済み: Star Strider 2021 年 9 月 20 日
for i=1:m
for j=1:n
A=myfunction(...)
end
end
where the output A is the square matrix.
How to save output A for each iteration

採用された回答

Star Strider
Star Strider 2021 年 9 月 19 日
Since ‘A’ is a matrix, save it as a cell array —
for i=1:m
for j=1:n
A{i,j} = myfunction(...)
end
end
.
  2 件のコメント
Ammy
Ammy 2021 年 9 月 20 日
Thank you very much.
Star Strider
Star Strider 2021 年 9 月 20 日
As always, my pleasure!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by