Borrar filtros
Borrar filtros

Finding frequency of values above a certain value in a matrix

2 visualizaciones (últimos 30 días)
I have a 301X301 matrix (M). How do I find number of cells above a certain value?
Thanks in advance.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 12 de Oct. de 2020
Editada: Ameer Hamza el 12 de Oct. de 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

Más respuestas (0)

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by