Development Environment |
Creating a New M-File in the Editor/Debugger
To create a new M-file in the Editor/Debugger, either click the new file button on the MATLAB toolbar, or select File -> New -> M-file from the MATLAB desktop. You can also create a new M-file using the context menu in the Current Directory browser--see Creating New Files. The Editor/Debugger opens, if it is not already open, with an untitled file in the MATLAB current directory from which you can create an M-file.
If the Editor/Debugger is open, create more new files by using the new file button on the toolbar, or select File -> New -> M-file.
Function Alternative
Type edit
in the Command Window to create a new M-file in the Editor/Debugger. Type edit filename.m
to open the M-file filename.m
in the Editor/Debugger.
If filename.m
does not exist, a prompt appears asking if you want to create a new file titled filename.m
.
filename.m
. If you do not want the dialog to appear in this situation, select that check box in the dialog. Then, the next time you type edit filename.m
, the file is created without first prompting you. If you later want that dialog to appear, specify it in preferences for Prompt.
edit filename.m
, a "file not found
" message appears. If you later want that dialog to appear, specify it in preferences for Prompt.
Starting the Editor/Debugger | Opening Existing M-Files in the Editor/Debugger |