| Contents | Index |
To interactively fit a surface, follow the steps in this simple example:
Load some data at the MATLAB command line.
load franke
Open Curve Fitting Tool. Enter:
cftool
In Curve Fitting Tool, select X Data, Y Data and Z Data.
Curve Fitting Tool creates a default interpolation fit to the data.
Choose a different model type using the fit category drop-down list, e.g., select Polynomial.
Try different fit options for your chosen model type.
Select File > Generate Code.
Curve Fitting Tool creates a file in the Editor containing MATLAB code to recreate all fits and plots in your interactive session.
See Interactive Fitting for information on the following topics:
Fitting a surface
Selecting fit settings
Fitting multiple surfaces
Comparing surface fits
Generating code files and exporting fits to the workspace
For details and examples of specific model types and fit analysis, see the following sections:
To programmatically fit a surface, follow the steps in this simple example:
Load some data.
load franke
Create a fit using the fit function, specifying the variables and a model type (in this case poly23 is the model type).
f = fit( [x, y], z, 'poly23' )
Plot your fit and the data.
plot(f, [x,y], z)
To programmatically fit surfaces, see the following topics:
For details and examples of specific model types and fit analysis, see the following sections:
![]() | Curve Fitting | Spline Fitting | ![]() |
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |