-
大小: 1KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-05-16
- 语言: Matlab
- 标签: matlab Laguerre polynomial
资源简介
matlab程序,产生广义拉盖尔多项式系数,亲测可行。如果要生成多项式,需要乘上变量

代码片段和文件信息
function y = LaguerreGen(varargin)
%LaguerreGen calculates the generalized Laguerre polynomial L{n alpha}
%
% This function computes the generalized Laguerre polynomial L{nalpha}.
% If no alpha is supplied alpha is set to zero and this function
% calculates the “normal“ Laguerre polynomial.
%
% Input:
% - n = nonnegative integer as degree level
% - alpha >= -1 real number (input is optional)
%
% The output is formated as a polynomial vector of degree (n+1)
% corresponding to MatLab norms (that is the highest coefficient is the
% first element).
%
% Possible usage:
% - polyval(LaguerreGen(n alpha) x) evaluates L{n alpha}(x)
% - roots(LaguerreGen(n alpha)) calculates roots of L{n alpha}
% Calculation is done recursively using matrix operations for very fast
% execution time. The formula is taken from Szeg? Orthogonal Polynomials
% 1958 formula (5.1.10)
% Author: Matthias.Trampisch@rub.de
% Date: 16.08.2007
% Version 1.2
%% ====================================================================== %
% set default parameters and rename input
% ======================================================================= %
if (nargin == 1) %only one parameter “n“ supplied
n = varargin{1};
alpha = 0; %set defaul value for alpha
elseif (nargin == 2) %at least two parameters supplied
n = varargin{1};
alpha = varargin{2};
end;
%% ====================================================================== %
% error checking of input parameters
% ======================================================================= %
if (nargin == 0) || (nargin > 2) || (n~=abs(round(n))) || (alpha<-1)
error(‘n must be integer and (optional) alpha >= -1‘);
end;
%% ====================================================================== %
% Recursive calculation of generalized Laguerre polynomial
% ======================================================================= %
L=zeros(n+1); %reserve memory for faster storage
switch n
case 0
L(1:)=1;
otherwise %n>1 so we need to do recursion
L(1:)=[zeros(1n) 1];
L(2:)=[zeros(1 n-1) -1 (alpha+1)];
for i=3:n+1
A1 = 1/(i-1) * (conv([zeros(1 n-1) -1 (2*(i-1)+alpha-1)] L(i-1:)));
A2 = 1/(i-1) * (conv([zeros(1 n) ((i-1)+alpha-1)] L(i-2:)));
B1=A1(length(A1)-n:1:length(A1));
B2=A2(length(A2)-n:1:length(A2));
L(i:)=B1-B2; % i-th row corresponds to L{i-1 alpha}
end;
end;
%% ====================================================================== %
% Define output
% ======================================================================= %
y=L(n+1:); %last row is the gen. Laguerre polynomial L{n alpha}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2846 2015-06-22 20:57 LaguerreGen.m
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论