Legendre polynomial fitting

Version 1.0.0.0 (1.97 KB) by Siqing Wu
Fitting data using a linear combination of Legendre polynomials
3.5K Downloads
Updated 31 Jul 2008

No License

Finds the weighting coefficients of the linear combination of a set of Legendre polynomials up to order N.

Three methods are available (actually just for fun): 'inv' (default) inverts the normal equation matrix directly, while 'chol' and 'qr' find the solution via Cholesky and QR decomposition, respectively. Although arbitrary large order is supported, usually small N suffices. Computation for Pearson's correlation coefficient and RMSE is also available.

(If you've downloaded an earlier version of this code, please replace it with this one.)

Cite As

Siqing Wu (2026). Legendre polynomial fitting (https://www.mathworks.com/matlabcentral/fileexchange/20932-legendre-polynomial-fitting), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0