how to average num of column for each row?

2 ビュー (過去 30 日間)
Lilya
Lilya 2017 年 8 月 23 日
回答済み: José-Luis 2017 年 8 月 23 日
Hi all,
Thank for the help in advance.
I have a matrix in dim. of 972 (rows) * 715 (columns) I want to make an average of each row then divided by the num of columns. the final matrix should be 972*1 could any one help me with this? in for loop (because I will apply it in addition for other matrices)
thank you so much.

採用された回答

José-Luis
José-Luis 2017 年 8 月 23 日
Taking your question literally would yield:
dummy = rand(972,215);
result = mean(dummy,2) ./ size(dummy,2)

その他の回答 (1 件)

KSSV
KSSV 2017 年 8 月 23 日
doc mean you can specify the dimension there and get what you want.
A = rand(972,715) ;
M = mean(A,2) ;

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by