Installation guide
3 Running Functions — Command Window and History
3 Save the file.
The
matlab file will modify the PATH environment variable, and then start
MATLAB.
Evaluating or Opening a Selection
Make a selection in the Command Window and press Enter or Return.The
selection is appended to whatever is at the prompt, and MATLAB executes it.
Similarly, you can select a statement from any MATLAB desktop tool,
right-click, and select Evaluate Selection from the context menu.
Alternativel y, after makin g a selection, use the shortcut key, F9,orforsome
tools, press Enter or Return. For examp l e, you can scroll up in the Command
Window, select a stateme nt you entered p revio usly, and then press Enter to
run it. If you try to evaluate a selection while MATLAB is busy, for example,
running an M-file, execution waits until the current operation is d one.
Yo u can open a function, file, variable, or Simulink model from the Command
Window. Select the name in the Command Window, and then right-click and
select Open Selection from the context window. This runs the
open function
for the item you selected so that it opens in the appropriate tool:
• M-files and other text files open in the Editor/D ebugg er.
• Fi gure files (
.fig)openinafigurewindow.
• Variables open in the Array Editor.
• M odels open in Simulink.
See the
open reference page for details about what action occurs if there a re
name conflicts. If no action exists to work with the selected item, Open
selection calls
edit.
Function Alternative
Use open or edit to open a file in the Editor/Debugger. Use type to di splay
theM-fileintheCommandWindow.
3-12