function L = Laguerre(a, i, x) % % Laguerre: L = Laguerre(a, i, x); % % Compute the generalized Laguerre polynomial of degree i according to % Eq. 18 of B-0002. The argument i may be a vector. % N = size(i,1); L = zeros(N,1); for j = 1: N k = 0:i(j); pk = cumprod(a+k); % k+1 -th element of this vector = (1+a)_k of B-0002 L(j) = pk(i(j)+1) * sum((-x).^k ./ (pk .* gamma(k+1) .* gamma(i(j)-k+1))); end