-
大小: 1KB文件类型: .zip金币: 1下载: 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实现
- PAPR问题的MATLAB程序
- 朴素贝叶斯分类matlab实现
- Matlab的PMSM矢量控制电流环仿真模型原
- SLIC超像素分割matlab代码
- PMSM MatLab仿真模型
- 时频重排同步压缩matlab
- Matlab 区域标记与面积计算
- QT调用matlab引擎
- FIR带通滤波器源代码
- matlab录音程序76107
- Dijkstra算法的Matlab程序,有验证。
- spasm工具包
- MATLAB中ifft函数用法、性质、特性以及
- MATLAB中fft函数用法、性质、特性、缺
- 滑模变结构控制第三版matlab仿真程序
- matlab计算节点重要度
- CT等距扇束重建
- 基于蚁群算法的图像边缘检测算法M
- 基于MOEA/D的多目标优化算法
- 含风电场的电力系统潮流程序matlab
- 跳频扩频系统的MATLAB仿真
- matlab 虫口方程特性
- matlab 分叉图
- 矩阵归一化matlab程序代码
- 机器人学中轨迹规划算法
- 基于MATLAB有噪声语音信号的处理
-
基于MATLAB/Simuli
nk的光伏电池建模与 - 牛顿迭代法求解非线性方程的Matlab程
- matlab 程序实现求f=x^2的最大值
评论
共有 条评论