hello , anyone kindly help me, i have a 91by91 matrix (A) generated in a loop of 140 . i want to add all the matrices in the various together into a final one which is also a 91by91. Thanks
1 回表示 (過去 30 日間)
古いコメントを表示
for i=1:length(data(:,1)) %%i is 140
A=sqrt(C.^2 + S.^2);
[L_max,M_max] = size(A); %%L_max,M_max =90
T_sum(i,1:M_max)=sum(A);
end
0 件のコメント
採用された回答
Image Analyst
2016 年 8 月 31 日
Try this
for i=1:length(data(:,1)) %%i is 140
A=sqrt(C.^2 + S.^2); % or whatever....
if i == 1
T_sum = A;
else
T_sum = T_sum + A;
end
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!