📄 l1.m
字号:
function X=L1(x,y,x1)
% input x is a vector that contains a list of abscissas
% y is a vector that cntains a list of ordinates
% x1 is the number at where the interpolation is to be obained
% output X is the linear interpolation at x1
n=length(x);
j=-1;
for i=1:n-1
if x1<x(i+1)&&x1>x(i)
j=i;
break;
end
end
if j==-1
'false';
return;
end
X=y(j)*(x1-x(i+1))/(x(i)-x(i+1))+y(i+1)*(x1-x(i))/(x(i+1)-x(i));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -