Entering Commands
While working in MATLAB, you issue commands that create variables and call functions. For an introduction, see Enter Statements in Command Window.
Functions
ans | Most recent answer |
clc | Clear Command Window |
diary | Log Command Window text to file |
format | Set output display format |
home | Send cursor home |
iskeyword | Determine if input is MATLAB keyword |
more | Control paged output in Command Window |
commandwindow | Enter statements at the command line |
commandhistory | View previously run statements |
Objects
DisplayFormatOptions | Output display format in Command Window (Since R2021a) |
Topics
- Enter Statements in Command Window
Enter individual statements in the Command Window while working in MATLAB.
- Format Output
Format the output display in the Command Window and the Live Editor.
- Calling Functions
MATLAB provides a large number of functions that perform computational tasks. To call a function, enclose its input arguments in parentheses.
- Stop Execution
Stop the execution of a MATLAB command.
- Rerun Favorite Commands
A MATLAB favorite command is an easy way to run a group of MATLAB commands that you use regularly.
- Write to a Diary File
Use the
diary
function to keep an activity log of your MATLAB session. - Find Text in Command Window or History
Search text currently in the Command Window or Command History.
- Modify Command Window Settings
Specify appearance and behavior of the Command Window and its output.
- Modify Command History Settings
Specify how often to save statements to the Command History and the types of statements to exclude.
- Modify Keyboard Settings
Settings for delimiter matching in the Command Window, Editor, and Live Editor.
Troubleshooting
Resolve Error: Unrecognized Function or Variable
Troubleshoot error message related to unrecognized function or variable.