MATLAB Curve Fitting (Ellipse-like)

后端 未结 2 1166
梦如初夏
梦如初夏 2021-01-13 12:22

I need to fit 10 data points (x,y) into this equation:

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

It\'s told that this is a ellipse-like equ

相关标签:
2条回答
  • 2021-01-13 12:57

    It is a linear system with variables [a b c d e]. 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
    
    0 讨论(0)
  • 2021-01-13 12:57

    Give this a shot:

    http://www.mathworks.com/matlabcentral/fileexchange/3215-fitellipse

    0 讨论(0)
提交回复
热议问题