Linear interpolation Using Polyfit
10 views (last 30 days)
Show older comments
How do i find p (polyfit) from this X1 and Y1 values i attached
I expect to get like this images
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374726/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374731/image.png)
0 Comments
Answers (1)
Bjorn Gustavsson
on 8 Oct 2020
Repeat question.
Perhaps explicitly telling you to use the call to polyfit in the documentation? Well do that, and you'll get a 7th order polynomial approximation to the sin-curve in that intervall.
Polynomial regression will not easily give you linear interpolation though, that is a completely different operation where you get points on line-segments connecting your data-points. See the help and documentation for interp1, for more information about that.
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!