legendreNodesWeights edit page

This script is for computing definite integrals using Legendre-Gauss Quadrature. Computes the Legendre-Gauss nodes and weights on an interval [a,b] with truncation order N

Suppose you have a continuous function f(x) which is defined on [a,b] which you can evaluate at any x in [a,b]. Simply evaluate it at all of the values contained in the x vector to obtain a vector f. Then compute the definite integral using sum(f.*w);

Written by Greg von Winckel - 02/25/2004

Syntax

[x,w] = legendreNodesWeights(N,a,b)