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!