How to mean all array?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
format long g
A = [NaN 1 1; 2 NaN 2; 1 NaN 2; 4 2 2]
mean(A, 'all', 'omitnan')
1 Commento
sky walker
il 16 Giu 2021
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!