フィルターのクリア

How to sum two rows at a time in matrix

2 ビュー (過去 30 日間)
Vishal Sharma
Vishal Sharma 2017 年 6 月 19 日
回答済み: Adam 2017 年 6 月 19 日
I have a matrix of size 6 by 3
A = [1 2 3; 3 4 5; 4 5 6; 5 4 3; 3 4 3; 3 2 1]
I want to make sum of two rows at a time, so as to get result
[18; 27; 16]

採用された回答

Adam
Adam 2017 年 6 月 19 日
sum( reshape( A', 6, 3 ) )

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by