0

I have a set of data in 2D give me an ellipse I am looking for a MatLab function or any other function in programming languages that gives me a best fit for the 2D ellipse to a cone, I used cftool function in MatLab but it gave another shape not a cone results from cftool function

  • 3
    Hi, welcome to Stack Overflow. The best way to get help here is to show what you've tried and describe what didn't work. Looks like you've tried something from the image, but you should add the code to your question. See [ask] – Justin Mar 18 '20 at 19:26
  • 1
    That said, there will be an infinite number of cones that can fit an ellipse (as a conic section) so you'll probably need to be more precise in your required output? – Justin Mar 18 '20 at 19:32
  • write a small function of an ellipse, caculate the difference to your data as the sum of least squares + fit this by using one of the *optimization algorithms* of matlab, eg. `lsqnonlin`, `fmincon`, or `fminsearch`. – max Mar 19 '20 at 06:57

0 Answers0