finding the average in a matrix

Hi, I have a matrix 62599x60 double. I want the average of the 60 columns in every row. The output should be a 62599x1 matrix.

 採用された回答

Image Analyst
Image Analyst 2014 年 12 月 7 日

1 投票

averagesAcrossColumns = mean(M, 2);

1 件のコメント

Image Analyst
Image Analyst 2014 年 12 月 7 日
If you want the sum, use sum() instead of mean().
sumsAcrossColumns = sum(M, 2);
If you want the min or max, it's slightly different in that you need to insert [] before the dimension argument.
minsAcrossColumns = min(M, [], 2);
maxsAcrossColumns = max(M, [], 2);

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperating on Diagonal Matrices についてさらに検索

質問済み:

AA
2014 年 12 月 7 日

コメント済み:

2014 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by