I have a series of repeated data points that i am trying to fit with a skewed curve. In the graph I am showing one set of the data points which are in blue. The black hand drawn line is the kind of fit i want for my data. I want my fit to be a curve like the one drawn, not a combination of two linear functions or a sawtooth. I have included the data points in text files. Thank you.

댓글 수: 4

Walter Roberson
Walter Roberson 2018년 7월 19일
Your fit has multiple y values for the same x. Is that desired, or should it instead be unique y values for each x (just possibly steep) ?
Angela
Angela 2018년 7월 19일
Although in the plot it looks like there are multiple values for the same x, in reality they are unique. For example for X=4172,Y=55.31 the next point is X=4173,Y=56.71. The plot is just very steep on the left side. Thank you.
Walter Roberson
Walter Roberson 2018년 7월 19일
편집: Walter Roberson 2018년 7월 19일
That may be true for the input data, but the black line you show us as the desired fit distinctly wobbles back and forth on the x axis, and since that is presented as your desired outcome, the implication could be that you want the output function to have multiple y values for some of the x.
Anyhow... so if a sharp corner is not desired, then what turn radius should be used?
Do you have a model for what you want the function to be like?
Angela
Angela 2018년 7월 19일
The wobble is because i am not very good at drawing a straight line but the intent was for that line to be straight. You are right, the model that i want should be almost a straight line on the left side, unfortunately i do not have a model function, i am trying to built a model based on this data so i do not have the form, I am just trying to fit the data. Thank you.

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

 채택된 답변

Matt J
Matt J 2018년 7월 19일

1 개 추천

My suggestion would be a hyperbola, but rotated.

댓글 수: 3

Angela
Angela 2018년 7월 19일
The problem with the rotated hyperbola is that it has a form of f(x,y), the y is because of the rotation. I am familiar with fitting a f(x) but i am not sure how to fit a f(x,y) function.
Matt J
Matt J 2018년 7월 20일
편집: Matt J 2018년 7월 20일
You are only interested in the positive portion of the hyperbola, so you can write that portion as,
y=a*sqrt(1+(x/b)^2);
which will be like the green curve in the image below. You can also rotate your input x,y data about 135 degrees counter-clockwise so that it will also have a corresponding profile like the red lines in the image below.
Now everything is oriented in a familiar way.
Angela
Angela 2018년 7월 23일
Thank you, it worked well!

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 7월 19일

0 개 추천

댓글 수: 1

Angela
Angela 2018년 7월 19일
Thank you for the suggestion. I did try that but unfortunately it does not give me the curved shape i want, it looks more like a combination of 2 linear fits (one for the sloped line on the right and another one that is almost straight for the left side).

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

카테고리

도움말 센터File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

질문:

2018년 7월 19일

댓글:

2018년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by