dynamic name for matrices

2 visualizaciones (últimos 30 días)
Elia
Elia el 22 de En. de 2014
Comentada: Amit el 22 de En. de 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

Respuestas (2)

dpb
dpb el 22 de En. de 2014

Amit
Amit el 22 de En. de 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 comentario
Amit
Amit el 22 de En. de 2014
you dont need to create a dynamic matrix for T. Simple indexing would work.

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by