function yout = LaguerreH(m,nn,xx)
mat = cat(4,ones(size(xx)),-xx + m + 1,0.5*(xx.^2 - 2*(m+2)*xx + (m+1)*(m+2)));
for say = 4:nn+1
    mat(:,:,:,say) = ((m + 2*say - 3 - xx).*mat(:,:,:,say-1) - (say-2+m)*mat(:,:,:,say-2))/(say - 1);
end
yout = mat(:,:,:,nn+1);