i have data for x and y values,by using these how to find a polynomial X=0.042672375396118 and Y=-0.17386168 , -0.18001581 , -0.19355754 ,

댓글 수: 4

Rik
Rik 2018년 6월 18일
You have only a single x-value and 3 y-values?
If you have x-y pairs you can use polyfit.
shahul thaufeek
shahul thaufeek 2018년 6월 18일
but in polyvit i am getting only answers,but my need is polynomial whether we can get polynomial using least square method can u tell me how to use least square method in matlab
Rik
Rik 2018년 6월 18일
Actually you don't get corresponding values from polyfit. You get the parameters. So for a third order polynomial described as y=p1*x^3+p2*x^2+p3*x+p4, polyfit will return a vector p formed by p=[p1 p2 p3 p4];
And it does use the least-squares method, as you can read in the doc.
Rik
Rik 2018년 6월 24일
Please don't use the answer field for comments, nor should you accept an answer if it doesn't solve your question.
If you have three sets of y-values and want to fit a single polynomial to your data, you need to replicate the x-values.

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

 채택된 답변

shahul thaufeek
shahul thaufeek 2018년 6월 23일
편집: Image Analyst 2018년 6월 24일

0 개 추천

Actually I have value like these
data is X value and
other columns are y values

댓글 수: 1

Image Analyst
Image Analyst 2018년 6월 24일
Looks like you figured it out yourself since you've accepted this answer. So I guess there's nothing left for us to answer or help you out with.

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

추가 답변 (0개)

카테고리

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

태그

질문:

2018년 6월 18일

댓글:

2018년 6월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by