How to save matrix created in each iteration

조회 수: 1 (최근 30일)
Vishal Sharma
Vishal Sharma 2017년 1월 18일
편집: Andrei Bobrov 2017년 1월 18일
n=1;
while n<4
k=[1 2 3 4;5 6 7 8];
k=k*n;
n=n+1;
display(n)
display(k)
end

채택된 답변

Andrei Bobrov
Andrei Bobrov 2017년 1월 18일
One of ways
n=1;
k=[1 2 3 4;5 6 7 8];
out = zeros([size(k),3]);
while n<4
k=k*n;
out(:,:,n) = k;
n=n+1;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by