Documentation Center    • Trial Software   • Product Updates
Enter Statements in Command Window  As you work in MATLAB®, you
can enter individual statements in the Command Window. For
example, create a variable named a by typing this statement at
the command line:  a = 1  MATLAB immediately adds variable a to
the workspace and displays the result in the Command Window.  a
=    ans =   The value of ans changes with every command that
returns an output value that is not assigned to a variable.   b
= 2;  To enter multiple statements on multiple lines before
running any of the statements, use Shift+Enter between
statements. This action is unnecessary when you enter a paired
keyword statement on multiple lines, such as for and end.  You
also can enter more than one statement on the same line by
separating statements. To distinguish between commands, end each
one with a comma or semicolon. Commands that end with a comma
display their results, while commands that end with a semicolon
do not. For example, enter the