How to save matrixes resulted from a running loop for further use in MATLAB
조회 수: 1 (최근 30일)
이전 댓글 표시
I am running a code in which for each cycle i am getting different matrix of size 30 X 30. I have to use the matrixes in the next loop so please tell me how can i save the matrix.
댓글 수: 0
답변 (1개)
KSSV
2023년 3월 28일
Let mxn be your matrix size and you are running loop ntimes. In this case you can save the matrix in the loop using the below code snippet.
A = zeros(m,n,n) ;
for i = 1:n
A(:,:,i) = % calculations/ formula
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!