Azzera filtri
Azzera filtri

Finding frequency of values above a certain value in a matrix

2 visualizzazioni (ultimi 30 giorni)
I have a 301X301 matrix (M). How do I find number of cells above a certain value?
Thanks in advance.

Risposta accettata

Ameer Hamza
Ameer Hamza il 12 Ott 2020
Modificato: Ameer Hamza il 12 Ott 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

Più risposte (0)

Categorie

Scopri di più su Linear Algebra in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by