How to find a polynomial of degree 2 that fits the given data with minimal approximation error? and then sketch discrete points and the graph of the polynomial
6 次查看(过去 30 天)
显示 更早的评论
Suppose you have the following data: (0, 1.0000), (0.25, 1.2840), (0.50, 1.6487), (0.75, 2.1170) and (1.00, 2.7183) . Find a polynomial P (x) of degree 2 that fits the data with the minimal approximation error. Calculate this error. Then sketch these discrete points and the graph of the polynomial P(x) in a figure using MATLAB.
0 个评论
回答(2 个)
the cyclist
2019-4-7
You could use the polyfit and plot commands (and of course a few more fundamental calculations like subtraction) to do this.
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!