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!