rot90
Rotate a matrix in units of 90 degrees,
y=rot90(a)
y=rot90(a,n)
Inputs
a Any matrix.
n The number of times to rotate the matrix.
Outputs
y The rotated matrix.


Example
>>a=[2 3 4;5 6 7;8 9 10];
>>a
          2          3          4
          5          6          7
          8          9         10

>>rot90(a)
          4          7         10
          3          6          9
          2          5          8

>>rot90(a,2)
         10          9          8
          7          6          5
          4          3          2

>>rot90(a,3)
          8          5          2
          9          6          3
         10          7          4

>>rot90(a,4)-a
          0          0          0
          0          0          0
          0          0          0