mean of logical array(s)
古いコメントを表示
How to estimate the logical mean of multidimensional logical array???
3 件のコメント
Stephen23
2017 年 5 月 15 日
mean(A(:))
Adam
2017 年 5 月 15 日
What is the 'logical mean'?
Walter Roberson
2017 年 5 月 15 日
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.
回答 (1 件)
Walter Roberson
2017 年 5 月 15 日
nnz(A) / numel(A)
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!