返回目录

LstApprox_Ration.m

text/plain
356 bytes
2025-10-22 16:15:59

文件预览

function [Ratn,Rnx]=LstApprox_Ration(vec_x,vec_y)
% 有理连分式逼近计算程序,

Ratn(:,1)=vec_y';
[s]=length(vec_x);
for i=2:s
   for j=2:i
     Ratn(i,j)=(vec_x(i)-vec_x(j-1))/(Ratn(i,j-1)-Ratn(j-1,j-1));
   end
end

syms x
k=s;vkx=Ratn(s,s);

while k>1
    vkx=Ratn(k-1,k-1)+(x-vec_x(k-1))/vkx;
    k=k-1;
end
Rnx=simplify(vkx);