Desktop Tools and Development Environment Previous page   Next Page

Creating a New File in the Editor/Debugger

To create a new text file in the Editor/Debugger, either click the New M-file button on the MATLAB desktop toolbar, or select File -> New -> M-File from the MATLAB desktop. The Editor/Debugger opens, if it is not already open, with an untitled file in the MATLAB current directory, in which you can create an M-file or another type of text file.

The location of the new file and the Editor/Debugger are determined by document positioning guidelines. You can rearrange the documents to suit your needs. For details, see Opening and Arranging Documents.

If the Editor/Debugger is open, create more new files by using the New M-file button on the toolbar, or select File -> New -> M-File.

Other tools also provide features for creating new M-files. For example, in the Command History, select statements, right-click, and select Create M-File from the context menu. Similarly, create a new file from the context menu in the Current Directory browser--see Creating New Files.

Function Alternative

Type edit in the Command Window to create a new file in the Editor/Debugger.

Type edit filename.ext to create the file filename.ext. If filename.ext already exists in the current directory or on the MATLAB search path, this opens the existing file. If filename.ext does not exist in the current directory or on the MATLAB search path, a confirmation dialog box might appear asking if you want to create a new file titled filename.ext:

For more information about the confirmation dialog box, see preferences for Confirmation Dialogs.


Previous page  Starting, Customizing, and Closing the Editor/Debugger Opening Existing Files in the Editor/Debugger Next page

© 1994-2005 The MathWorks, Inc.