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!