how to sum every each rows on matrix

3 ビュー (過去 30 日間)
Risma Fitriyani
Risma Fitriyani 2022 年 12 月 27 日
コメント済み: Image Analyst 2022 年 12 月 27 日
i have size matrix 5x25, i want to sum every each rows and the output would be 5x1 matrix. how to do that? thanks in advance

採用された回答

Rik
Rik 2022 年 12 月 27 日
編集済み: Rik 2022 年 12 月 27 日
You can use the sum function:
data=rand(5,25);
sum(data,2)
ans = 5×1
13.3903 13.2063 14.1058 14.1462 11.5026
  1 件のコメント
Image Analyst
Image Analyst 2022 年 12 月 27 日
@Risma Fitriyani To learn other fundamental concepts, invest 2 hours of your time here:

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by