i am new to matlab and i want to learn, can anyone help me with this please!!!!
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to compute and plot the regression polynomial of degree 2 for some datapoints and than I want to estimate the value of the function at the point x¯ = 2.5 by using the obtained regression polynomial of degree 2
댓글 수: 3
John D'Errico
2022년 1월 22일
편집: John D'Errico
2022년 1월 22일
Since this is surely a homework problem, what have you tried? Why not use polyfit? If you have no idea how to use that tool, and cannot read the help, then you need to read the manuals. Spend some time with the various tutorials. The point being, there are plenty of simple tutorials to be found, and what you are asking for is already written up in the help.
채택된 답변
Image Analyst
2022년 1월 22일
See my attached demo for polyfit. It will be easy for you to adapt it.
coefficients = polyfit(x, y, 2);
yFit = polyval(coefficients, 2.5);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!