sum of an array
Mostrar comentarios más antiguos
How do I get the sum of an array which contains some NaN. I am getting some error like this:
sum(a,'omitNaN')
??? Error using ==> sum
Trailing string input must be 'double' or 'native'.
a = Columns 1 through 5
NaN 664.7000 663.2000 662.2000 NaN
Columns 6 through 10
688.4000 688.4000 NaN NaN NaN
Columns 11 through 15
NaN NaN NaN NaN NaN
Columns 16 through 20
NaN NaN 731.4000 723.0000 704.8000
Also, when I am calculating mean and standard deviation, do i have to include NaN or omit it?
Thank you,
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!