Info
此问题已关闭。 请重新打开它进行编辑或回答。
In any matrix, how to generated by sum' same along rows
1 次查看(过去 30 天)
显示 更早的评论
any matrix is "a". ex) a=[4 4 5 5 5 5 5 5 5 5]; sum(a) is equal to '48'
if one matrix exist, how to generate along rows by same' sum '48'?
0 个评论
回答(1 个)
Star Strider
2017-2-21
The column dimension is the second dimension (the row dimension is the first, and the default in a matrix), so to sum the rows of matrix ‘A’, the code is:
A_row_sum = sum(A, 2);
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!