How can I perform curve / surface fitting for data of more than three dimensions?

24 views (last 30 days)
The Curve Fitting Toolbox works with data of two or three dimensions. How can I perform similar tasks on data of more than three dimensions?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Apr 2021
Edited: MathWorks Support Team on 24 Mar 2021
There are three options for performing curve-fitting tasks on data of more than three dimensions:
You can use MATLAB's backslash operator to do linear regression on multidimensional data.  Please refer to the following link for documentation on the backslash operator:
If it is expected that there is a linear relationship between the variables, the `regress` function in the Statistics and Machine Learning Toolbox can be used to calculate coefficients for a linear curve. Please refer to the following link for documentation on 'regress':
A more general tool for curve fitting N-dimensional data is the 'lsqcurvefit' function in the Optimization Toolbox, which solves nonlinear curve-fitting problems in least-squares sense. Using  'lsqcurvefit' requires creating a function representing the expected relationship which has parameters that can be adjusted to fit the data. 'lsqcurvefit' determines the optimal values for those parameters so that the function fits the data. Please refer to the following link for documentation on 'lsqcurvefit':

More Answers (0)

Products


Release

R2016b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!