how to average num of column for each row?
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
José-Luis
2017-8-23
Taking your question literally would yield:
dummy = rand(972,215);
result = mean(dummy,2) ./ size(dummy,2)
0 个评论
更多回答(1 个)
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) ;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!