フィルターのクリア

create new array with for

2 ビュー (過去 30 日間)
Josefina Ottitsch
Josefina Ottitsch 2019 年 3 月 5 日
コメント済み: madhan ravi 2019 年 3 月 5 日
Hello,
I have a code similar to the following:
for z=1:5
'A''num2str(z)'=[1;3*z]
end
I would like my program to create a new array A'z' (ex:A1=[1;3*1],...A5=[1;3*5]) for every for loop, I do not want to have an added row to my array, I really want to create a new array.
How do I do this?
Thank you for the support!
  1 件のコメント
madhan ravi
madhan ravi 2019 年 3 月 5 日
why do you need to use a loop?

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

採用された回答

KSSV
KSSV 2019 年 3 月 5 日
A = zeros(2,5) ;
for z=1:5
A(:,z) = [1;3*z] ;
end
A(:,1) % this is A1
A(:,3) % this is A3
It is useless to geenrate A1,A2....etc.......you need not to do that.

その他の回答 (0 件)

カテゴリ

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