how to count values in a matrix

조회 수: 1 (최근 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 CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by