how to sum of column without sum function in a unit metrix
11 次查看(过去 30 天)
显示 更早的评论
x1 = [1 2 3; 4 5 6; 7 8 9];
all =(x1);
summa=0;
count = 0;
for i=1:length(all)
% fprintf("%d\n",i);
summa = 0;
for j = 1:length(all)
summa = summa + all(j);
% fprintf("%d ",j);
end
fprintf("%d ",summa);
end
I want to sum every column without sum function , i tried it but i can't can anyone help me please ?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!