how to realize look up function in m script

2 次查看(过去 30 天)
hello, i have x axle table and y axle table, when i set value within the range of x, how to get the output from y, may be some interpolation and curve smoothing should used. i hope it works in m script.
  8 个评论

请先登录,再进行评论。

采纳的回答

wenchao zhang
wenchao zhang 2024-7-5
编辑:Walter Roberson 2024-7-5
use interp1 seems ok,
x = 0:pi/4:2*pi;
v = sin(x);
xq = 0:pi/16:2*pi;
figure
vq2 = interp1(x,v,xq,'spline');
plot(x,v,'o',xq,vq2,':.');
xlim([0 2*pi]);
title('Spline Interpolation');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Smoothing 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by