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 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
KSSV
am 9 Nov. 2017
Your question is already answered here.
To ignore NaN's while finding mean using nanmean.
1 Kommentar
Guillaume
am 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')
Siehe auch
Kategorien
Mehr zu NaNs 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!