summaryrefslogtreecommitdiff
path: root/transverse/LaguerrePoly.m
blob: b29d3d0aae5506101b20a34f69fb4dfa14aeb9c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
%-----------------------------------
% Associated Laguerre Polynomial
% (See e.g. Arfken section 13.2)
%
% SYNTAX y=Lnk([n,k],x)
%-----------------------------------

function y=LaguerrePoly(params,x)

n=params(1);
k=params(2);

m=[0:n];

a=factorial(n+k)*ones(1,length(m));
b=factorial(n-m);
c=factorial(k+m);
d=factorial(m);
e=(-1).^m;

y=zeros(size(x));
for s=1:n+1;
    y = y + a(s) ./ b(s) ./ c(s) ./ d(s) .* e(s) .* x.^m(s);
end