Edit or create file
edit opens a new file called
the Editor. MATLAB® does not automatically save
edit opens the
specified file in the Editor. If
file does not
already exist, MATLAB asks if you want to create it.
include a partial path, complete path, relative path, or no path.
file includes a partial path or no path,
look for the file on the search path. You must have write permission
to the path to create
file, otherwise, MATLAB ignores
You must specify the extension to open
.mdl files. MATLAB cannot
directly edit binary files, such as
A new file titled
Untitled opens in the MATLAB Editor
(or default editor).
Untitled does not appear in
your Current Folder.
mkdir tests edit tests/new_script.m
A dialog box appears, asking if you want to create
If you select Yes, MATLAB creates and
edit file1 file2 file3 file4
MATLAB sequentially creates and opens the files:
file4 in sequence.
file— Name of filestring
Name of file, specified as a string. If
a path that contains a nonexistent folder, MATLAB throws an error.
Specify multiple files on the same line by separating filenames with
file is overloaded (that is, appears in
multiple folders on the search path), then include a partial path
to edit the correct page, such as
If you do not specify the extension, then
a file with the specified name and a
If the file is part of a class or package, then either specify the path and extension, or separate the components of the name with periods, such as:
edit className.name edit packageName.name edit packageName.className.name edit packageName.name