How to save output of loop in matrix ?
5 ビュー (過去 30 日間)
古いコメントを表示
I have 1000*129*135 3D array. I want to store the output of following programe in matrix form.
for i=1:129 j=1:135;
b=a(:,i,j)
% some operation on b
c=output %after operation on b
end
I want to save output of all iteration in 129*135 matrix. How to do that?
0 件のコメント
回答 (1 件)
Aravind Ravikumar
2019 年 6 月 20 日
編集済み: Aravind Ravikumar
2019 年 6 月 20 日
output_matrix = zeros(129,135);
Then you could assign output c to the respective index in the matrix. For example inside your for loop in the script you could insert the following code,
output_matrix(i,j) = c;
Your required matrix will be output_matrix.
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!