How to save 14*14 matrix in each iteration?

2 ビュー (過去 30 日間)
M
M 2022 年 3 月 31 日
回答済み: Image Analyst 2022 年 3 月 31 日
How to save 14*14 matrix in each iteration?
There are 128 iterations and in each iteration there is a matrix named Vd with size 14*14 updated.
How can I save the Vd matrix in each iteration in a perefect way? So I can also perform calculations on these saved matrices by one time?

採用された回答

Stephen23
Stephen23 2022 年 3 月 31 日
編集済み: Stephen23 2022 年 3 月 31 日
N = 128;
C = cell(1,N);
for k = 1:N
.. your code
C{k} = Vd;
end
  1 件のコメント
M
M 2022 年 3 月 31 日
Thanks @Stephen

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2022 年 3 月 31 日
You can use a 3-D array:
numZ = 128;
allVd = zeros(14, 14, numZ); % Declare an array to hold all 128 of the Vd.
for k = 1 : numZ
% Code to get a new Vd.
Vd = whatever.......
% Then store Vd in the k'th slice of the 3-D array:
allVd(:, :, k) = Vd;
end

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by