- Matlab commands are executed line by line in a sequential order.
- A Matlab command may be terminated with a semicolon.
- The semicolon is optional and suppresses the output.
You can execute multiple commands in a single line by writing different commands on the same line separated by semicolon(;).
a=1; b=2; c=3;
If you want to execute multiple commands in a single line without suppressing its output, you can separate the commands on the line by a comma(,). This is called comma chaining of commands.
a=1, b=2, c=3
>> a = 1 b = 2 c = 3