how to count values in a matrix

1 vue (au cours des 30 derniers jours)
Leon Phung
Leon Phung le 7 Juin 2018
Commenté : Leon Phung le 7 Juin 2018
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)

Réponse acceptée

Walter Roberson
Walter Roberson le 7 Juin 2018
volumefraction = mean2(YourMatrix>100);
  1 commentaire
Leon Phung
Leon Phung le 7 Juin 2018
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 3-D Volumetric Image Processing dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by