Averaging Every Element of some matrices
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Joydeb Saha
am 6 Okt. 2020
Bearbeitet: Stephen23
am 7 Okt. 2020
I have 40 matrices of 12x1. How can I take the the each element of every matrix and get a averaged matrix which will be 12x1
1 Kommentar
Akzeptierte Antwort
Stephen23
am 6 Okt. 2020
The simple answer is to concatenate all of your matrices into one array, and then use mean. Of course all of your matrices should be in one cell array, because that makes them much easier to work with:
C{1} = [..];
C{2} = [..];
..
C{40} = [..];
A = cat(3,C{:});
M = mean(A,3)
Weitere Antworten (1)
KSSV
am 6 Okt. 2020
Read about mean. You can specify your required dimension to get the mean along.
A = rand(12,1,40) ;
M = mean(A,3) ;
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!