poly fit warning when drawing vertical curves

Im trying to draw quadratic curves using polyfit function on points that is almost vertical to illustrate a particular shape. eg across points (0,0) (1,5) (0,5) Obviously it would generate warning for having 2 identical x coordinates, is there any alternative I can use to avoid the warning without changing the coordinates of the points? Or is there other functions available to do that?
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 10일

0 개 추천

No. If you have duplicate x coordinates then that is not a polynomial curve. It might be a rotation of a polynomial but not a polynomial.

댓글 수: 3

If i were to do a rotation of a polynomial function, how can i achieve it? The polynomial is intended to be part of a for loop. How can I tell the program to do a rotation instead if a warning pops up?
Exchange your x and y coordinates, fit that, polyval(), exchange back
I have plot a quadratic using exchanged x and y coordinates, now what code can i use to reflect the curve along y=x?

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

카테고리

도움말 센터File Exchange에서 Polynomials에 대해 자세히 알아보기

질문:

2016년 1월 10일

댓글:

2016년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by