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

采纳的回答

Image Analyst
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 CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by