Development Environment    

Opening Existing M-Files in the Editor/Debugger

To open an existing M-file in the Editor/Debugger, click the open button on the MATLAB or Editor/Debugger toolbar, or select File -> Open. Then, from the Open dialog box, select the M-file and click Open. You can also open files from the Current Directory browser - see Opening Files.

You can select a file to open from the most recently used files, which are listed at the bottom of the File menu in the desktop as well as in the Editor/Debugger. You can change the number of files appearing on the list - see Preferences for the Editor/Debugger.

If the Editor/Debugger is not already open, it opens with the file displayed. If it is already open, the file appears either in its own window or as a tab in the current window as specified in Opening files in editor. To make a document in the Editor/Debugger become the current document, click on it or use the Window menu or tabs.

You can set a preference that instructs MATLAB on startup to automatically open the files that were open when the previous MATLAB session ended. For instructions, see the On restart preference in General Preferences for the Editor/Debugger.

Function Equivalent

Use the edit or open function to open an existing M-file in the Editor/Debugger. For example, type

to open the file collatz.m in the Editor/Debugger.

Opening a Selection

Within a file in the Editor/Debugger, select a function, right-click, and select Open Selection from the context menu. The file opens in the Editor/Debugger.

Getting Help for a Function

Within a file in the Editor/Debugger, select a function, right-click, and select Help on Selection from the context menu. The reference page for that function opens in the Editor/Debugger, or if the reference page does not exist, the M-file help is shown instead.

Accessing Your Source Control System

If you use a source control system for M-files, you can access it from within the Editor/Debugger to check out files. See Chapter 9, Interfacing with Source Control Systems.


 Creating a New M-File in the Editor/Debugger Opening the Editor Without Starting MATLAB