How many positive entries in array
Mostra commenti meno recenti
I have a 1450x1 array. I want to count how many positive entries in array?
Risposta accettata
Più risposte (2)
hidayet beyhan
il 28 Mar 2020
Modificato: hidayet beyhan
il 28 Mar 2020
1 voto
Or you can use for an array:
x = randn(1450,1);
sum(x>0)
Varshitha Gouri
il 7 Lug 2026
function count = positiveEntries(arr)
count = sum(arr > 0);
end
Categorie
Scopri di più su Matrices and Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!