Creating a Bell Curve of Data

조회 수: 152 (최근 30일)
Claire Hollow
Claire Hollow 2020년 6월 17일
댓글: Claire Hollow 2020년 6월 17일
Hello. I have a large set of temperature observations called tmax (26298x1 double) and I want to make a bell curve of all the data to see what it looks like. I've done a lot of browsing and can't find a simple way to do this. Does anyone have help on this? Thank you!
  댓글 수: 1
Claire Hollow
Claire Hollow 2020년 6월 17일
Heres a little update. I tried
pd = fitdist(tmax01,'Normal')
y=normpdf(tmax01,63.8972,21.5533);
figure(1)
plot(tmax01,y)
but the curve is a mess of so many lines, how do I get just one?

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

채택된 답변

David Hill
David Hill 2020년 6월 17일
편집: David Hill 2020년 6월 17일
Just looking at your data, histogram() function is useful.
histogram(tmax01,30);%however many bins you want
You could overlay:
pd = fitdist(tmax01,'Normal');
x_values = min(tmax01):.1:max(tmax01);%not sure what step to use
y = pdf(pd,x_values);
hold on;
plot(x_values,y,'LineWidth',2);
histogram(tmax01,30);
  댓글 수: 1
Claire Hollow
Claire Hollow 2020년 6월 17일
That helped a lot, thank you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by