how to count values in a matrix

2 ビュー (過去 30 日間)
Leon Phung
Leon Phung 2018 年 6 月 7 日
コメント済み: Leon Phung 2018 年 6 月 7 日
I have a matrix with size 1887x2048, for each element is a number from 0 to 255. I want to find out how many elements is bigger than 100 and how many smaller than 100 (aka volume fraction)

採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 7 日
volumefraction = mean2(YourMatrix>100);
  1 件のコメント
Leon Phung
Leon Phung 2018 年 6 月 7 日
oh wow, I'm trying to write a for loop that switching everything to 0 and 1 to solve this and you just nailed it with a single line, thank you very much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by