Other Miscellaneous Information

When you're getting bored of programming, you can always ask why:

>> why

A very rich programmer wanted it that way.

By placing a semicolon at the end of a line, you suppress the output. For example,

>> diag([1 2 3 4])

ans =

     1     0     0     0
     0     2     0     0
     0     0     3     0
     0     0     0     4

>> diag([2 4 6 8]);

If you do not assign the last result to anything, it is automatically assigned to the variable ans:

>> x = 3 + eye(2)

x =

     4     3
     3     4

4 - 2*eye(2)

>> ans =

     2     4
     4     2

>> ans + x

ans =

     6     7
     7     6