Effacer les filtres
Effacer les filtres

Finding frequency of values above a certain value in a matrix

2 vues (au cours des 30 derniers jours)
Ishani Mukherjee
Ishani Mukherjee le 12 Oct 2020
Commenté : Ameer Hamza le 12 Oct 2020
I have a 301X301 matrix (M). How do I find number of cells above a certain value?
Thanks in advance.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 12 Oct 2020
Modifié(e) : Ameer Hamza le 12 Oct 2020
Use nnz(): https://www.mathworks.com/help/matlab/ref/nnz.html with the logical matrix
thresh; % threshold value
n = nnz(M > thresh) % number of element over 'thresh' value
  2 commentaires
Ishani Mukherjee
Ishani Mukherjee le 12 Oct 2020
It's working. Thanks again.
Ameer Hamza
Ameer Hamza le 12 Oct 2020
I am glad to be of help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Linear Algebra 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!

Translated by