Development Environment    

Running Functions and Entering Variables

The prompt (>>) in the Command Window indicates that MATLAB is ready to accept input from you. When you see the >> prompt, you can enter a variable or run a function. For example, to create A, a 3-by-3 matrix, type

When you press the Enter or Return key after typing the line, MATLAB responds with

To run a function, type the function including all arguments and press Return or Enter. MATLAB displays the result. For example, type

and MATLAB returns

If you want to enter multiple lines before running, use Shift+Enter or Shift+Return after each line until the last. Then press Enter or Return to run all of the lines.

The K>> prompt in the Command Window indicates that MATLAB is in debug mode. For more information, see Chapter 7, Editing and Debugging M-Files.

Evaluating a Selection

To run a selection in the Command Window, make the selection, and then right-click and select Evaluate Selection from the context menu. You cannot evaluate a selection while MATLAB is busy, for example, running an M-file.

Opening a Selection

To open the M-file for a function, select that function in the Command Window, and then right-click and select Open Selection from the context window. The M-file for that function opens in the Editor/Debugger.

Running One Process

You can only run one process at a time. If MATLAB is busy running one function, any commands you issue will be stacked. The next command will run when the previous one finishes. For example, you cannot set breakpoints from the Editor/Debugger while MATLAB is running a function in the Command Window.


 Running MATLAB Functions Controlling Input and Output