I have a function that takes an N X M array, A, and I want to take the sum of each column. The sum of the rows and sums of the two diagonals, the major diagonal first.
1 次查看(过去 30 天)
显示 更早的评论
function [s] = multiSum(A)
s=sum(A(:,end))
end
采纳的回答
Walter Roberson
2023-2-16
2 个评论
the cyclist
2023-2-16
I'm not convinced they "found" sum, as opposed to being given this function framework to adapt for a homework assignment. :-)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!