Compute average of each row in different matrices

2 ビュー (過去 30 日間)
PIRIL
PIRIL 2014 年 2 月 24 日
回答済み: Walter Roberson 2014 年 2 月 24 日
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

採用された回答

Walter Roberson
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 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by