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!