资源简介
插值程序代码matlab版function,可轻松改为fortran或c
代码片段和文件信息
function [ oy1oy2] = intechzh( x y z ii)
%INTECHZH Summary of this function goes here
% Detailed explanation goes here%
m = length(x);
% n = length(z);
a(1:m) = 1;
%for ji=1:n
for i=1:m
% a(i)=1;
for j=1:m
if j~=i
a(i)=a(i)*(z-x(j))/(x(j)-x(i));
% elseif j~=i && x(j)==x(i)
% a(i)=a(i)*1;
else
a(i)=a(i)*1;
end
end
end
%end
for i=1:m
b(i)=a(i)*y(i);
end
oy1=0;
%for ji=1:n
for i=1:m
oy1=oy1+b(i);
end
%end
%%% @@@@@@@ ii为相应插值点前一项
if ii>=3 && ii<=m-3
yy(1:6)=y([ii-2ii-1iiii+1ii+2ii+3]);
xx(1:6)=x([ii-2ii-1iiii+1ii+2ii+3]);
% end
elseif ii==m-1 || ii==m-2
yy(1:4)=y([ii-2ii-1iii
- 上一篇:PN码matlab程序
- 下一篇:财政收入预测模型matlab源码
评论
共有 条评论