calculating mean values of a 3D matrix
Show older comments
hi.
I have a 3D matrix. size 79x63x100
I want to calc the mean of each of the 79x63 values so to get a 2D matrix the size of 79x63x1
but when i do mean(mat) i get it in the size of 1x63x100
how should I write it?
Thanks, Noa
2 Comments
Deepak Singh
on 15 Jul 2015
You can mention the dimension you want to take mean across. Something like this will work: x=mean(mat,3);
ankit patel
on 11 Apr 2020
its not working if i change the value 3 with more than 3 in your equation.
Accepted Answer
More Answers (1)
Zoe
on 28 Nov 2017
shape2 = reshape(yourarray,[100 79*64]);
meanArray = mean(shape2,2);
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!