Compute average of each row in different matrices
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
I have 50 matrices and I want to compute average of each row in a matrix with the correspoding rows in the other matrices.
For instance I have two matrices
A=[3,4,5;2,6,7] B=[5,9,1;1,7,2]
and I want to obtain
average=[4,6.5,3;1.5,6.5,4.5]
Many thanks
댓글 수: 0
채택된 답변
Walter Roberson
2014년 2월 24일
(A + B)./2
If you wanted to average all 50 together,
mean( cat(3, A, B, C, ....M50), 3)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!