How to generate different variables to store different sets of matrix?

1 回表示 (過去 30 日間)
Patrick
Patrick 2014 年 11 月 15 日
コメント済み: Star Strider 2014 年 11 月 15 日
Using for loop, 35 different matrices are generated in my codes. How can I generate 35 different variables to store them respectively?

採用された回答

Star Strider
Star Strider 2014 年 11 月 15 日
Just DON’T!
Create a multidimensional matrix, or if your matrices are different sizes, use a cell array.
  4 件のコメント
Patrick
Patrick 2014 年 11 月 15 日
Thanks man, my problem is resolved!
Star Strider
Star Strider 2014 年 11 月 15 日
My pleasure!
If you want to call the matrix created at iteration 20 of the loop, you can refer to it as:
M(:,:,20)
However if you want to do calculations with it, it’s sometimes easier to create a separate temporary matrix for it, for instance:
Mt = M(:,:,20);
to avoid having to write all the subscripts each time you use it in your calculations.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by