Weird fitting result from using 'ksdensity'

조회 수: 5 (최근 30일)
Yiran Chang
Yiran Chang 2021년 2월 10일
댓글: Yiran Chang 2021년 2월 12일
I have a histogram of frequency distribution (pic 1), theoretical there could be more than one peak, so I used ksdensity for fitting. But I got a reallly weird fitting.(pic 2)
code I used:
figure
x = [Tracks.norm_amp];
histogram(x,'Normalization','probability')
[f,xi] = ksdensity(x,'kernel','normal','support','positive');
hold on
plot(xi,f)
It wil be great if someone can help me! Thanks a lot!

채택된 답변

Jeff Miller
Jeff Miller 2021년 2월 11일
Try
histogram(x,'Normalization','pdf')
  댓글 수: 1
Yiran Chang
Yiran Chang 2021년 2월 12일
Worked! I really appreciate your help!

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by