Calculate mean value of every element of a .mat file
3 views (last 30 days)
Show older comments
Jon Ordóñez Devesa on 20 May 2022
Commented: Jon Ordóñez Devesa on 23 May 2022
I have a .mat file which contains 300 matrixes all of which have the same dimensions of 256x320. I want to calculate the mean value of each matrix, with a for circle maybe, thus obtaining 300 vectors. Then I want to put all those vectors in a single matrix. Thanks in advance.
Edited: Matt J on 20 May 2022
S = structfun( @mean, load('yourFile.mat'),'uni',0);
More Answers (1)
Ilya Dikariev on 20 May 2022
that should work if you want your end matrix in a single row
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!