Sine curve fitting for the given data
이전 댓글 표시
I have a set of data,I need to fit the data to sine curve ..
Suggest a code..
Thanks
채택된 답변
추가 답변 (1개)
Andreas Goser
2015년 3월 31일
편집: Andreas Goser
2015년 3월 31일
0 개 추천
"Suggest a code"...
Well, anyway, let us know if you have the Curve Fitting Tbx or Optimization Tbx available (output of 'ver' command) and provide a sample of data like 20 data points and then we can suggest an approach for you to code.
댓글 수: 4
Betha Shirisha
2015년 3월 31일
Torsten
2015년 3월 31일
If xdata is the first column and ydata is the second column of your file data11.txt, you can use
myfun=@(x,xdata)(x(1)*sin(x(2)*xdata+x(3)));
x0=[1; 1; 1];
[x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata);
Best wishes
Torsten.
Torsten
2015년 3월 31일
Sorry, should read
[x,resnorm] = lsqcurvefit(myfun,x0,xdata,ydata);
Best wishes
Torsten.
Betha Shirisha
2015년 3월 31일
카테고리
도움말 센터 및 File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
