Typing commands in the MATLAB Command Window is one of the primary ways to interact with MATLAB. It’s an immediate way to execute commands, perform calculations, access functions, and see immediate results. Here’s how you can use the Command Window:
- Accessing the Command Window: When you open MATLAB, the Command Window is usually the first window you see. It’s where you can type commands directly.
- Entering Commands: You can type MATLAB commands directly into the Command Window and press Enter to execute them. For instance, you can perform basic arithmetic operations like addition, subtraction, multiplication, and division:

When you type c, MATLAB will display the value of c, which is the sum of a and b.
3. Variable Assignment: MATLAB uses the assignment operator = to assign values to variables. You can create variables and assign values to them within the Command Window.
4. Running Scripts and Functions: You can also run scripts and functions stored in files by typing their names (without the file extension) in the Command Window. For example, if you have a script named my_script.m, you can execute it by typing my_script in the Command Window and pressing Enter.
5. Accessing Help: MATLAB provides extensive help documentation. Typing help followed by a function name or a topic in the Command Window provides information about that function or topic. For instance:

This will display help information about the clc function.
6. Workspace and Variables: The Command Window also displays information about the variables currently in the workspace. Typing whos shows a list of variables along with their sizes and types.
7. Command History: You can access previously entered commands using the up and down arrow keys, which is helpful for recalling and reusing commands without retyping.