mean of logical array(s)
Mostra commenti meno recenti
How to estimate the logical mean of multidimensional logical array???
3 Commenti
Stephen23
il 15 Mag 2017
mean(A(:))
Adam
il 15 Mag 2017
What is the 'logical mean'?
Walter Roberson
il 15 Mag 2017
Good question. It might be the majority. If so then
majority = nnz(A)*2 > numel(A);
The majority is not well defined if exactly half are one way and half are the other way.
Risposte (1)
Walter Roberson
il 15 Mag 2017
nnz(A) / numel(A)
Categorie
Scopri di più su Matrices and Arrays 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!