Compute Legendre L2 norm
y=legendre_norm(n)
a 1-by-1 matrix of doubles, integer value, n>=0.
a matrix of doubles, the norm
Returns the integral:
where Pn is Legendre polynomial.
// Check that int Pn(x)^2 w(x) dx=2/(2n+1). function y=sqPw(x, n) y=legendre_eval(x,n)^2 endfunction for n = 1:5 [v,err]=intg(-1,1,list(sqPw,n)); I=legendre_norm(n); disp([n,I,v]) end