
Writing Simple Expressions É 11
Several variables (or expressions) can also be defined in the same line separated by a comma (,)
or a semicolon (;). When a comma is used, the system displays the variable and its value on the
command line. For example, when you type the following:
>> x = 1.1, y = 3.3, z = 5.5
MATLAB responds with the following display:
x =
1.1
y =
3.3
z =
5.5
The use of semicolons in the place of commas would suppress the outputs. For example, when
you enter, the following:
>> x = 3.5; y = 1.9; z = 2.75;
The command window does not display the values as was done in the former case; yet in both
cases, the variables appear in the ...