mean of logical array(s)

4 次查看(过去 30 天)
Rupak Bhattacharya
Rupak Bhattacharya 2017-5-15
How to estimate the logical mean of multidimensional logical array???
  3 个评论
Adam
Adam 2017-5-15
What is the 'logical mean'?
Walter Roberson
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
Walter Roberson 2017-5-15
nnz(A) / numel(A)

类别

Help CenterFile Exchange 中查找有关 Special Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by