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개)

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 Exchange에서 Loops 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