How many positive entries in array
古いコメントを表示
I have a 1450x1 array. I want to count how many positive entries in array?
採用された回答
その他の回答 (2 件)
hidayet beyhan
2020 年 3 月 28 日
編集済み: hidayet beyhan
2020 年 3 月 28 日
1 投票
Or you can use for an array:
x = randn(1450,1);
sum(x>0)
Varshitha Gouri
2026 年 7 月 7 日
function count = positiveEntries(arr)
count = sum(arr > 0);
end
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!