How to find the average for the roundness value?

조회 수: 1 (최근 30일)
junnie vix
junnie vix 2017년 11월 18일
댓글: Image Analyst 2017년 11월 19일
I have already found 40 values for roundness . Now I want find the average to categorize them into different categories. Any idea to do the average calculation?

답변 (1개)

Image Analyst
Image Analyst 2017년 11월 18일
How about mean()?
meanRoundness = mean(allRoundnesses);
where allRoundnesses is a 1-D array of all your 40 roundness values.
  댓글 수: 2
junnie vix
junnie vix 2017년 11월 19일
편집: Image Analyst 2017년 11월 19일
roundness = 4 * pi * area ./ (perimeter .^ 2)
output(i,:) = {roundness, fileName};
This is my sample of coding. How do I find the all roundnesses?I still can't get it
Image Analyst
Image Analyst 2017년 11월 19일
It appears to be code inside a loop over i. So index roundness in the loop
roundness(i) = 4 * pi * area ./ (perimeter .^ 2)
then outside/after the loop, use mean() like I showed you in the code above.
meanRoundness = mean(roundness);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by