Can I use the fit() function to fit an ellipse on x,y data (covers only a part of the ellipse, not equally distributed around it) ? Could you please tell me how to do this? Thank you!

2 views (last 30 days)
Can I use the fit() function to fit an ellipse on x,y data (covers only a part of the ellipse, not equally distributed around it) ? Could you please tell me how to do this?
I cannot enter the equation to fit() because the equation of an ellipse ( (x-x0)^2/(a^2) + (y-y0)^2/(b^2) = 1 ) cannot be brought to a y = f(x) form...
If I cannot do it by fit(), is there ant other simple way?
I need: the center (x0,y0), the equation and the peak value (highest y).
Thank you!
  1 Comment
Istvan
Istvan on 19 Jul 2017
fit_ellipse() ( https://uk.mathworks.com/matlabcentral/fileexchange/3215-fit-ellipse ) fails, saying: Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In fit_ellipse (line 155) stopped because of a warning regarding matrix inversion
... and
EllipseDirectFit ( http://uk.mathworks.com/matlabcentral/fileexchange/22684-ellipse-fit--direct-method- ) will not work, as this solution expects to have data all around the ellipse. I only have data on about 30% of it.

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!