3D Least squares polynomial fit in x and y

Fit a two dimensional f(x,y) polynomial to sampled x,y,z data triplets

You are now following this Submission

Often, measured data is comprised of N sampled values of z, evaluated at N locations (x,y). With this function, you can calculate the coefficients of the best-fit x,y polynomial using a linear least squares approximation.

You can use this function if you have a set of N data triplets x,y,z, and you want to find a polynomial f(x,y) of a specific form (i.e. you know the terms you want to include (e.g. x^2, xy^3, constant, x^-3, etc.) in your fitting polynomial.

Cite As

Thomas (2026). 3D Least squares polynomial fit in x and y (https://www.mathworks.com/matlabcentral/fileexchange/24062-3d-least-squares-polynomial-fit-in-x-and-y), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0