Development Environment    

Saving M-Files

After making changes to an M-file, you see an asterisk (*) 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:

You cannot save a file while in debug mode. First, exit debug mode and then save the file.

Autosave

As you make changes to a file in the Editor, every five minutes the Editor automatically saves a copy of the file to a file of the same name but with an .asv extension. The autosaved copy is useful if you have system problems and lose changes made to your file. In that event, you can open the autosaved version, filename.asv, and then save it as filename.m to use the last good version of filename.

Use Autosave Preferences for the Editor/Debugger to turn the autosave feature off or on, to specify the number of minutes between automatic saves, and to specify the file extension and location for autosaved files.

Autosaved files are not automatically deleted when you delete the source file. So if, for example, you rename a file, delete the .asv version of the original filename.

If the M-file you are editing is in a read-only directory, an autosave copy of the file is not made.

Running M-Files from the Editor/Debugger

You can run a script or a function that does not require an input argument directly from the Editor/Debugger. Click the run button on the toolbar, or select Run from the Debug menu.

If the file is not in a directory on the search path or in the current directory, a dialog box appears, presenting you with options that allow you to run the file. You can either change the current directory to the directory containing the file, or you can add the directory containing the file to the search path.

Note that if the file has unsaved changes, running it from the Editor/Debugger automatically saves the changes before running. In that event, the menu item is Save and Run.

See Running an M-File with Breakpoints for additional information about running M-files while debugging.


  Incremental Search Printing an M-File