How to mean all array?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sky walker
el 16 de Jun. de 2021
Comentada: KSSV
el 16 de Jun. de 2021
Hi, im using matlab r2018a
lets say i have array
A = [NaN 1 1; 2 NaN 2; 1 NaN 2; 4 2 2]
how to get mean of all of it?
i need the result is 1.888889
i try using
z = mean(A(:))
but the answer is
z = NaN
0 comentarios
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 16 de Jun. de 2021
format long g
A = [NaN 1 1; 2 NaN 2; 1 NaN 2; 4 2 2]
mean(A, 'all', 'omitnan')
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!