MATLAB Function Reference | ![]() ![]() |
Graphical Interface
As an alternative to the edit
function, select New or Open from the File menu in the MATLAB desktop.
Syntax
edit edit fun edit file.ext edit class/fun edit private/fun edit class/private/fun
Description
edit
opens a new editor window.
edit fun
opens the M-file fun.m
in the default editor.
edit file.ext
opens the specified text file.
edit class/fun
can be used to edit a method, private function, or private method (for the class named ,
edit private/fun, or edit class/private/fun
class
).
Remarks
To specify the default editor for MATLAB, select Preferences from the File menu. On the Editor/Debugger panel, select MATLAB's Editor/Debugger or specify another.
UNIX Users
If you run MATLAB with the -nodisplay
startup option, or run without the DISPLAY
environment variable set, edit
uses the External Editor
command, meaning it does not use the MATLAB Editor/Debugger, but instead uses the default editor defined for your system in $matlabroot/X11/app-defaults/Matlab
.
You can specify the editor that the edit
function uses or specify editor options by adding the following line to your own .Xdefaults
file, located in ~home
.
matlab*externalEditorCommand: $EDITOR -option $FILE
$EDITOR
is the name of your default editor, for example emacs
; leaving it as $EDITOR
means your default system editor will be used.-option
is an option flag for the specified editor$FILE
means the filename you type with the edit
command, will open in the specified editorThen, before starting MATLAB, run
xrdb -merge ~home/.Xdefaults
For the HP 700 platform, the default editor is instead defined in $matlabroot/toolbox/matlab/general/edit.m
. To change it,
open the file edit.m
and edit the line
eval( ['!$EDITOR "' file '" &'
See Also
![]() | echo | eig | ![]() |