dynamic name for matrices

i want to create a dynamic name for the matrices , that are generated through a loop .
for j=1:x
for i=1:y
.
.
%a matrix with the name T is generated for every time the loop runs
T(i)=...
end
A(j)=T(:)
end
A(j) didn't work in the parent loop

回答 (2 件)

dpb
dpb 2014 年 1 月 22 日

0 投票

Amit
Amit 2014 年 1 月 22 日

0 投票

A = zeros(x,y);
for j=1:x
for i=1:y
.
.
%a matrix with the name T is generated for every time the loop runs
T(i)=...
end
A(j,:)=T(:)
end

1 件のコメント

Amit
Amit 2014 年 1 月 22 日
you dont need to create a dynamic matrix for T. Simple indexing would work.

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

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2014 年 1 月 22 日

コメント済み:

2014 年 1 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by