polyint.m
来自「matlab code for new user to design any p」· M 代码 · 共 18 行
M
18 行
function yp = polyint(x,y,xp)
% function polyint(x,y,xp)
% perform polynomial interpolation
% input: x,y - data vectors
% xp - new abscissa vector
% output: yp - polynomial interpolation on xp value(s)
%
n = length(x);
for i=1:n
for j=1:n
a(i,j) = x(i)^(j-1);
end
end
b=a\y';
b = b(n:-1:1); % reverses order of polynomial coefficients
yp = polyval(b,xp); % evaluate polynomial interpolation on xp
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?