Legendre polynomial fitting
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
Platform Compatibility
Windows macOS LinuxCategories
- AI and Statistics > Curve Fitting Toolbox > Linear and Nonlinear Regression >
- MATLAB > Mathematics > Elementary Math > Polynomials >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
