Clear Filters
Clear Filters

dynamic name for matrices

3 views (last 30 days)
Elia
Elia on 22 Jan 2014
Commented: Amit on 22 Jan 2014
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

Answers (2)

dpb
dpb on 22 Jan 2014

Amit
Amit on 22 Jan 2014
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 Comment
Amit
Amit on 22 Jan 2014
you dont need to create a dynamic matrix for T. Simple indexing would work.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!