
Using Basic Plotting Functions
Saving Figures
Save a figure by selecting Save from the File menu to display a Save dialog
box. MATLABsavesthedataitneedstorecreate the figure and its contents
(i.e., the entire graph) in a file with a
.fig extension.
To save a figure using a standard graphics format, such as TIFF, for use
with other application s, select Export Setup from the File menu. You can
also s ave from the command line—use the
saveas command, including any
options to save the figure in a d ifferent format. The more restricted
hgexport
command, which saves figures to either bitmap or metafile files, depending on
the rendering method in effect, is also available.
See “Exporting the Graph ” on pa ge 3-46 for an exa m ple.
Saving Workspace Data
You can save the variables in your workspace by selecting Save Workspace
As from the figure File menu. You can reload saved data using the Import
Data item in the figure File menu. MATLAB supports a variety of data file
formats, including MATLAB data files, which have a
.mat extension.
Generating M-Code to Recreate a Figure
You can generate MATLAB code that recreates a figure and the graph it
contains by selecting Generate M-File from the figure File menu. This
option is particularly useful if you have dev elo pe d a graph using plotting tools
and want to create a similar graph using the same or different data.
Saving Figures That Are Compatible with the Previous Version
of MATLAB
Create backward-compatible FIG -f iles by following these two steps:
1 Ensure that any plotting functions used to create the contents of the figure
are called with the
'v6' argumen t, where applicable.
2 Use the '-v
6'
option with the hgs ave command.
3-61
Kommentare zu diesen Handbüchern