Basic fitting MATLAB: Fitting the data with approximate curve.
조회 수: 16 (최근 30일)
이전 댓글 표시
I have plotted X-Y data using MATLAB (image on left in fig.), I have total 19300 data points which I got from experiments. I have used tools like "spline interpolant", "shape-preserving interpolat" etc to do basic fitting, but it does not satisfy my requirement. What I want is smooth curve which should look like red curve shown in figure (right fig.). Further, I also want to get information out of red curve, for example slope of the curve at various points on red curve. Can you please suggest me an appropriate tool for these two purposes. Thank you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149285/image.jpeg)
댓글 수: 0
채택된 답변
추가 답변 (1개)
Chandramouli Gnanasambandham
2015년 9월 22일
windowSize = 70;
b = (1/windowSize)*ones(1,windowSize);
a= 1;
out = filter(b,a,ydata);
plot(xdata,ydata,'.')
hold on
grid on
plot(xdata,out,'r','LineWidth',2);
hold off
hope this helps :)
댓글 수: 1
Chandramouli Gnanasambandham
2015년 9월 22일
for the slope calculation at every data point try using the 'diff' command
참고 항목
카테고리
Help Center 및 File Exchange에서 Curve Fitting Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!