The information from Ed Shen is crucial: "The code works, however you must divde A(2), A(4) and A(5) by 2 to be able to use it with the Mathworld equations."
Without these divisions the rusulting elippse does not really fit to the points.

4

05 Nov 2013

Ellipse Fit (Direct method)
Fits an ellipse to a set of points on a plane; returns the coefficients of the ellipse's equation

Hello,
I am trying to use this file to fit an ellipse to an elliptical hysteresis loop from data points in a 2X200 array. I get the error "Attempted to access A(4); index out of bounds because numel(A)=0." I am not sure what the problem is- can you help?

Comment only

11 Dec 2012

Ellipse Fit (Direct method)
Fits an ellipse to a set of points on a plane; returns the coefficients of the ellipse's equation

Comment only