Installation guide

6 Editing and Debugging M-Files
Saving, Printing, and Closing Files in the Editor/Debugger
In this section...
“Saving Files” on page 6-62
“Printing M -Files” on page 6-64
“Closing M-Files” on page 6-64
Saving Files
After making changes to an file, you see an asteris k (*) next to the filename
in the title bar of the Editor/Debugger. This indicates there are unsaved
changes to the file.
To save the changes, use one of the Save commands in the File menu:
Save —Savesthefileusingitsexistingname. Ifthefileisnewlycreated,
the Save file as dialog box opens, where you assign a name to the file
beforesavingit.AnotherwaytosaveisbyusingtheSavebutton
on the
toolbar. If the file has not been changed, Save is grayed out, but you can
instead use Save As from the File menu to save to a different filename.
Save As —TheSave file as dialog box opens, where you assign a name to
the file and save it. By default, i f you do not type an e xtension, MATLAB
automatically assigns the
.m extension t o the filename. If you do n ot want
an extension, type a
. (period) after the filename.
Save All Saves all named files to their existing filenames. For all newly
created files, the Save file as dialog box opens, where you assign a name to
each untitled file and save it.
YoucannotsaveanM-filewhileindebugmode. Ifyoutryto,MATLAB
displays a dialog box asking if you want to exit debug mode and then save
thefile. Whiledebugging,youcanexecute sections of an M-file even though
there are unsaved changes see “Running Sections in M-Files That Have
Unsaved Changes” on page 6-125.
6-62