Enforcing a particular curve to fit the data points

1 次查看(过去 30 天)
Hi, I am trying to fit some data points so that the trend is first any polynomial function and then it becomes a plateau. In the figure below I am ok with the first part of the fitting but I am trying to get a plateau approximately from the crossed symbol to the end. Of course the point from where the curve will be a plateau needs to be determined by the function and not by me.
So far I tried the code below to fit:
figure
ft = fittype('f*x^5+e*x^4+d*x^3+b*x^2+c*x+a');
SS = fit(CMOD(1:end-1)',dEpsilonDtMean(1:end,1),ft,'StartPoint',[0,0,0,0,0,0],'Robust','Bisquare')
plot(SS,CMOD(1:end-1),dEpsilonDtMean(1:end,1))
  3 个评论
Mohammod Minhajur Rahman
The blue dots are raw data that ideally should have a plateau beyond 0.06 (just eye estimation), but it can never be achived practically, so I need to find the point from where the polynomial curve becomes a plateau. From the beginning, the first portion of these data should be fitted by a polynomial (not necessarily 5th order) and there should be a point (let's say 0.06) beyond which it should be a plateau. Basically, I need to find the point where the derivative of the fitting function becomes zero, and beyond that I can enforce a plateau manually. Of course I can not pick that point on eye estimation.
the cyclist
the cyclist 2021-5-6
The first step is to define -- just in words, not in code -- where the plateau begins.
I understand that you want the MATLAB code to figure out where the plateau begins; but code cannot figure it out if you cannot describe it.
So, when I look at the data -- how do I know I have reached the plateau region?
Also, just out of curiosity, why do you think a polynomial is the appropriate choice in the pre-plateau region? Why not, say, an oscillatory function that damps out exponentially?

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2021-5-5
编辑:Image Analyst 2021-5-5
What if you just made the y values constant after the x value of 0.6
index = find(x >= 0.06, 1, 'first');
CMOD(index:end) = 0.5; % Or whatever value you want the plateau to have.
plot(x, CMOD, 'b-')
  1 个评论
Mohammod Minhajur Rahman
Sorry, my bad, I edited the post now: Of course the point from where the curve will be a plateau needs to be determined by the function and not by me. So, bascically I am trying to find the point where the derivative of the polynomial will be zero for the first time, and beyond that point I can make all the y values similar to have a plateau till end.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by