how to find out how many columns have more than 50 elements which are greater than 1?

1 回表示 (過去 30 日間)
I currently have a matrix that's 100*100 size, and I wish to work out how many columns have more than 50 elements which are greater than 1. Is it possible to do it using only rudimentary functions like find(), mod(), length(), numel(), etc?

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 10 月 15 日
編集済み: KALYAN ACHARJYA 2019 年 10 月 15 日
I currently have a matrix that's 100*100 size, and I wish to work out how many columns have more than 50 elements which are greater than 1
Lets say matrix 100*100 named as data
idx=data>1;
result=sum(idx);
data2=result>50;
fprintf('The column number is: %d',sum(data2(:)));

その他の回答 (1 件)

TADA
TADA 2019 年 10 月 15 日
x = rand(100) * 2;
atLeast50 = sum(x > 1, 1) > 50;

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by