Programming |
Empty Matrices, Scalars, and Vectors
Although matrices are two dimensional, they do not always appear to have a rectangular shape. A 1-by-8 matrix, for example, has two dimensions yet is linear. These matrices are described in the following sections:
An empty matrix has one of more dimensions that are equal to zero. A two-dimensional matrix with both dimensions equal to zero appears in MATLAB as []
. The expression A = []
assigns a 0-by-0 empty matrix to A
.
A scalar is 1-by-1 and appears in MATLAB as a single real or complex number (e.g., 7
, 583.62
, -3.51
, 5.46097e-14
, 83+4i
).
Returning a Triangular Portion of a Matrix | The Empty Matrix |
© 1994-2005 The MathWorks, Inc.