I have a set of data, which on plotting x vs y, will give the plot as in this figure.I want to fit a parabola to this data and I've tried using the curve fitting tool in MATLAB. The only problem is that I'm getting an answer as shown here. I know the coordinates what the center or the peak of the parabola should be at. But when I use the custom equation option, I get the error "this expression has no coefficients or non scalar coefficients". I am new to this. Is there any way to specify the center and get the fit correctly? The center points are (352,595). Thanks.
1 Answers
0
votes
The thing you drawn in black by hand is not a parabola. It doesn't follow y=a*x^2+b
equation thus you can not fit it. It actually follows y=±sqrt(a*x)+b
. I am not sure if you can fit a function to this equation (actually they are 2 equations).
What you can do, as suggested in the comments, is swap the X/Y coordinates and fit the data in that way. Then you can numerically interpolate the result parabola and swap the coordinates again to have it in the original form.
However, be aware that if you do this, you'll have 2 solutions for each X and none for lots of them also.
x=a*y^2+b
fashion, instead that the standard one! Try swapping your X/Y coordinates – Ander Biguri