How to find the average for the roundness value?

1 次查看(过去 30 天)
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