How can I find it?
1 次查看(过去 30 天)
显示 更早的评论
how can I find f(-0,3) on matlab?
0 个评论
采纳的回答
Walter Roberson
2021-6-22
There is not just one answer: it depends upon what model function you use
x = [-0.4, 0, 0.4, 0.8, 1.2]
fx = [-0.204, -0.07, -0.006, 0.442, 1.658]
fx03 = interp1(x, fx, -0.3)
fx03s = interp1(x, fx, -0.3, 'spline')
p3 = polyfit(x, fx, 3);
fx03p3 = polyval(p3, -0.3)
The cubic fit looks pretty good.
更多回答(1 个)
Chunru
2021-6-22
You can use interp1 to interpolate. 'doc interp1' for more details.
x = [-0.4 0 0.4 0.8 1.2];
f = [-0.204 -0.07 -0.006 0.442 1.658];
y = interp1(x, f, -0.3)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spline Postprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!