Clear Filters
Clear Filters

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

2 views (last 30 days)
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

Answers (1)

KSSV
KSSV on 9 Nov 2017
  1 Comment
Guillaume
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')

Sign in to comment.

Categories

Find more on Creating and Concatenating 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!