资源简介
很好的帕德逼近程序,用于拟合计算,数值逼近,个人感觉很实用。
代码片段和文件信息
function YutouPADE
% =========================================================================
% YUTOUNILT M-file for calulation of Pade approximation
% Note: Pade approximation
%
% exp(z) = Pade(z) = N(z)/M(z) = sum( Ki/(z-pi))
% N(z) = bn*z^n + bn-1*z^n-1 + ... + b1*z + b0
% M(z) = am*z^m + am-1*z^m-1 + ... + a1*z + a0
%
% Last Modified by YuTou v2.5 17-Jul-2007 23:23:28
% =========================================================================
% ----- Direct commands for format dispaly of the results ----
clc
format long g
format compact
% -----
N = input( ‘Numerator odder N = ‘ );
M = input( ‘Denominator Order M = ‘ );
% If you just press the key ENTER the default value is M=10 and N=9
if isempty(M) || isempty(N)
M = 10;
N = 9;
disp( ‘You do not enter any number. System sets M=10 and N=9‘ );
end
% Coefficients of Polynomial N(z) and M(z)
BN = zeros( 1 N+1 );
AM = zeros( 1 M+1 );
IM = [ M :-1 : 0 ];
IN = [ N :-1 : 0 ];
% Multiplicity 1E-5 is just for accuracy
NF = fac
- 上一篇:计算机全息图案计算代码
- 下一篇:matlab实现带权重的线性回归
评论
共有 条评论