next up previous contents
Next: Programming in Matlab Up: Simple calculations and graphs Previous: Vectorized functions and operators;

Some miscellaneous commands

An important operator in Matlab is the single quote, which represents the (conjugate) transpose:

>> A = [1 2;3 4] 
A =
     1     2
     3     4
>> A'
ans =
     1     3
     2     4
>> B = A + i*.5*A
B =
   1.0000 + 0.5000i   2.0000 + 1.0000i
   3.0000 + 1.5000i   4.0000 + 2.0000i
>> B'
ans =
   1.0000 - 0.5000i   3.0000 - 1.5000i
   2.0000 - 1.0000i   4.0000 - 2.0000i
In the rare event that the transpose, rather than the conjugate transpose, is needed, the ``.''' operator is used:
>> B.'
ans =
   1.0000 + 0.5000i   3.0000 + 1.5000i
   2.0000 + 1.0000i   4.0000 + 2.0000i
(note that ' and .' are equivalent for matrices with real entries).

The following commands are frequently useful; more information can be obtained from the on-line help system.

Creating matrices

The commands zeros and ones can be given any number of integer arguments; with k arguments, they each create a k-dimensional array of the indicated size.

formatting display and graphics

Miscellaneous


next up previous contents
Next: Programming in Matlab Up: Simple calculations and graphs Previous: Vectorized functions and operators;

Mark S. Gockenbach
Wed Sep 8 10:44:13 EDT 1999