how to find out how many columns have more than 50 elements which are greater than 1?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Yuchen Song
le 15 Oct 2019
Commenté : Yuchen Song
le 15 Oct 2019
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?
0 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 15 Oct 2019
Modifié(e) : KALYAN ACHARJYA
le 15 Oct 2019
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(:)));
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!