mean of logical array(s)

4 views (last 30 days)
Rupak Bhattacharya
Rupak Bhattacharya on 15 May 2017
Commented: Walter Roberson on 15 May 2017
How to estimate the logical mean of multidimensional logical array???
  3 Comments
Adam
Adam on 15 May 2017
What is the 'logical mean'?
Walter Roberson
Walter Roberson on 15 May 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.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 15 May 2017
nnz(A) / numel(A)

Categories

Find more on Special Functions in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!