how to fit gaussian model and plot it

조회 수: 285 (최근 30일)
michael scheinfeild
michael scheinfeild 2015년 2월 23일
답변: zepp 2015년 2월 23일
hi i have vector of 1000 numbers i want to fit Gaussian model i use
[n,cent]=hist(x,50)
then
bs = glmfit(cent,n,'normal');
then i want to plot the fit yfit = glmval(bs,cent_s); failed Error using glmval (line 64) At least three arguments are required. i want to plot
plot(cent_s,yfit)

채택된 답변

zepp
zepp 2015년 2월 23일
You can do the following:
1) Estimate the mean and standard deviation using normfit
2) Calculate the probability estimates using normpdf
3) Plot the data and the estimates using plot
Example:
[m,s] = normfit(x);
y = normpdf(x,m,s);
plot(x,y,'.');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by