blob: 43b77d6de316072205baf3df48fedb3344f13edd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
%-----------------------------------
% Hermite Polynomial
% (See e.g. Arfken section 13.1)
%
% SYNTAX y=hermitepoly(n,x)
%-----------------------------------
function y=hermitepoly(n,x)
m=[0:floor(n/2)];
a=factorial(n-2*m);
b=factorial(m);
y=zeros(size(x));
for s=1:length(m)
y = y + factorial(n) ./ a(s) ./ b(s) .* (-1).^m(s) * (2*x).^(n-2*m(s));
end
|