MATLAB Curve Fitting (ellipse-like)

I need to set 10 data points ( x,y ) in this equation:

 ay² + bxy + cx + dy + e = x² 

He said this is an ellipse-like equation. I cannot do this with the usual curve fitting tools because it is not a function (one x corresponds to 2 y s). I cannot either use the ellipse curve setting because there is no c*x and d*y in the ellipse equation. Any ideas?

Thanks in advance.

EDIT: Both Oil and AK4749 gave the correct answer! Thanks guys!

+4
source share
2 answers

This is a linear system with variables [abcde]. You can use \ to solve it:

  x=rand(10,1); y=rand(10,1); [y.^2,x.*y,x,y,ones(numel(x),1)]\x.^2 ans = -0.4437 %% a 1.1034 %% b 0.5337 %% c -0.2808 %% d 0.0402 %% e 
+6
source

Source: https://habr.com/ru/post/1437674/


All Articles