How to find the sum of each element of a matrix?
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
dpb
2015년 6월 28일
If x is the array,
xsum=sum(x(:)); % ":" is a Matlab idiom that returns all elements in a column vector
댓글 수: 3
Image Analyst
2015년 6월 28일
That will work regardless of how many dimensions x has. By the way, a matrix is an array.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!