Calling automatically created matrices
3 ビュー (過去 30 日間)
古いコメントを表示
Using eval code I have created following matrices:
A1 = [0;0] A2 = [1;1] A3 = [2;2]
I want to call these matrices in a for loop such as;
for i=1:3
X=A(i)
end
Here A(i) should correspond to A1, A2 and A3 for increasing i values and X matrice will be equal to A1, A2 and A3 with each loop. Ultimately it will be equal to A3 obviously.
How can I write A(i) in correct form?
0 件のコメント
回答 (2 件)
Azzi Abdelmalek
2013 年 12 月 26 日
Instead of creating all those matrices, it's better to create one cell array containing all your matrices
X{1}=[0;0]
X{2}=[1;1]
X{3}=[2;2]
参考
カテゴリ
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!