MATLAB: How to determine the change in a ellipse shaped curve line

fitting ellipse to a data points

Hi i have some data points through which an ellipse curve will pass. However, this curve will constantly change. for example, say i have Points=[X(:,1) Y(:,1) Z(:,1)] and i want to choose 5 closely spaced points to be chosen and fit the ellipse to the data. it might sound easy to but i somehow could not find a solution to it. could anyone please explain how i could solve this? thank you very much in advance