# Gaussleg.m

Computes Gauss-Legendre points and weights.

## Syntax

    [x,w]=gaussleg(a,b,n)


## Description

The function calculates Gauss-Legendre points and weights in [a,b] interval with accuracy order n. If all existing numerical integration methods, Gauss-Legendre quadrature is one of the most efficient and accurate.

## Arguments

   a - left edge of the interval

b - right edge of the interval

n - accuracy order, the number of points in the
resulting grid will be n+1.


## Returns

   x - Gauss-Legendre points

w - Gauss-Legendre weights


## Examples

Gauss-Legendre quadrature is used in Gd(III) EPR and DEER examples to integrate over the distribution in the zero field splitting parameters.

## Notes

Gauss-Legendre quadratures of order exceeding 50 are numerically unstable, subdivide your interval instead of increasing the accuracy order.