Filter löschen
Filter löschen

Finding frequency of values above a certain value in a matrix

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

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 12 Okt. 2020
Bearbeitet: Ameer Hamza am 12 Okt. 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

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by