フィルターのクリア

How to save matrixes resulted from a running loop for further use in MATLAB

1 回表示 (過去 30 日間)
Chaudhary P Patel
Chaudhary P Patel 2023 年 3 月 28 日
回答済み: KSSV 2023 年 3 月 28 日
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.

回答 (1 件)

KSSV
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

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by