How to calculate mean and standard deviation in from the image sample

3 ビュー (過去 30 日間)
Esila Darci
Esila Darci 2021 年 2 月 8 日
コメント済み: Esila Darci 2021 年 2 月 11 日
Hello guys,
I have calculated the height of every rectangle, which are present in the image through the Pixel to micron conversion. But, i have to calculate following thing by automated loading the height previously
1) mean of height, μ = Formula (h1+h2+h3+h4)/4
2) standard deaviation for that height, σ= formula attached in the image
can you please tell me an code for that? so i can run that code to find out in my PC.
Additionally,if user only want to take 3 or 2 sample of height then can we put that condition so it can only calculate for 3 or 2 or according to user reuirements? I appreciate if you mention code for this option too.
Image attached in the comment
Thanks a lot in advance.
Esila
  8 件のコメント
Stuart Layton
Stuart Layton 2021 年 2 月 8 日
@Esila Darci please stop @ mentioning people
Esila Darci
Esila Darci 2021 年 2 月 8 日
I thought you are having expertise to answer my question. Sorry.

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

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 8 日
As you mentioned, you have the h1,h2,h3...(Already computed or known data)
mu=(h1+h2+h3+h4)/4;
And standard deaviation as per attached formula
N=4;
h=[h1,h2,h3,h4];
std_d=sqrt((1/N)*sum((h-mu)^2));
  3 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 11 日
"how to load the data automatically from my previous values"
Are you asking using the previous data, like calculate B(i) using B(i-1)??
Esila Darci
Esila Darci 2021 年 2 月 11 日
Kalyan you don't undestand the my question. I have calculated h1,h2,h3 and h4 for the current matlab program. In addition to this matlab code, i would like to recall this h1,h2,h3,h4 value so i can use it for the mean and standard deviation calculation.

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

Community Treasure Hunt

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

Start Hunting!

Translated by