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!