General conic curve fit with constrained coefficients

조회 수: 9 (최근 30일)
Scott Larwood
Scott Larwood 2021년 2월 26일
이동: Matt J 2023년 2월 21일
Hello,
I would like to fit a set of xy points to a general conic equation of the form:
ax^2 + bxy + cy^2 +dx + ey + f = 0
where I need to constrain the coefficient "c" to zero. So I would like to fit:
ax^2 + bxy +dx + ey + f = 0
to determine the values of the coefficients.
I have tried:
but I cannot determine how to contrain the coefficient. It gives me a good fit, but the coefficient "c" is non-zero. The fit is not good if I plot it with the "c" coefficient set to zero.
  댓글 수: 2
Matt J
Matt J 2021년 3월 1일
It would be recommendable to attach a single.mat file containing your x,y data, so we can play with it.
tarek hussein
tarek hussein 2023년 2월 21일
이동: Matt J 2023년 2월 21일
hello dear
how can i fit an ellipse from experimenta data(x and y vectors).. i really need to find the diameter of that ellipse.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2021년 3월 1일
편집: Matt J 2021년 3월 1일
Here's a basic analytical fit, using the tools in this File Exchange package:
[xy,T]=conicFit.homogNorm([x(:),y(:)].');
x=xy(1,:).'; y=xy(2,:).';
q = conicFit.mostnull([x.^2, x.*y, x, y, x.^0]);
C=[q(1), q(2), q(3);
0 0 q(4);
0 0 q(5)];
C= T.'*(C/2+C.'/2)*T;
[a, b, d, e, f] = deal(C(1), 2*C(4), 2*C(7), 2*C(8), C(9));

추가 답변 (1개)

Shadaab Siddiqie
Shadaab Siddiqie 2021년 3월 1일
From my understanding you want to create conic curve with constrained coefficients. Here is a similar question which might help you.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by