User`s guide
Saving Your Work
1-19
Generating an M-File
You may want to generate an M-file so that you can continue data exploration
and analysis from the MATLAB command line. You can run the M-file without
modification to recreate the fits and results that you created with the Curve
Fitting Tool, or you can edit and modify the file as needed. For detailed
descriptions of the functions provided by the toolbox, refer to Chapter 4,
“Function Reference.”
If you have many data sets to fit and you want to automate the fitting process,
you should use the Curve Fitting Tool to select the appropriate model and fit
options, generate an M-file, and then run the M-file in batch mode.
Save your work to an M-file by selecting the menu item
File->Save M-file from
the Curve Fitting Tool. The
Save M-File dialog is shown below.
The M-file can capture this information from the Curve Fitting Tool:
• All data set variable names, associated fits, and residuals
• Fit options such as whether the data should be normalized, the fit starting
points, and the fitting method
You can recreate the saved fits in a new figure window by typing the name of
the M-file at the MATLAB command line. Note that you must provide the
appropriate data variables as inputs to the M-file. These variables are given in
the M-file help.