I have a matrix of 100x100, and I need to do average of 10 - 10 row values, some are NaN's, those should be excloded, and finally i need 10x100 matrix, plz help
1 view (last 30 days)
Show older comments
I have a matrix of 100x100, and I need to do average of 10 - 10 row values, some are NaN's, those should be excloded, and finally i need 10x100 matrix, plz help
0 Comments
Answers (1)
KSSV
on 9 Nov 2017
Your question is already answered here.
To ignore NaN's while finding mean using nanmean.
1 Comment
Guillaume
on 9 Nov 2017
To ignore NaN's while finding mean using nanmean
For a few years now, the basic mean function has supported ignoring nans. No need for nanmeans:
mean(yourmatrix, 'omitnan')
See Also
Categories
Find more on NaNs 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!