Finding frequency of values above a certain value in a matrix

2 次查看(过去 30 天)
I have a 301X301 matrix (M). How do I find number of cells above a certain value?
Thanks in advance.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-10-12
编辑:Ameer Hamza 2020-10-12
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by