Programming |
Vectors
Matrices with one dimension equal to one and the other greater than one are called vectors. Here is an example of a numeric vector:
A = [5.73 2-4i 9/7 25e3 .046 sqrt(32) 8j]; size(A) % Check value of row and column dimensions ans = 1 7
You can construct a vector out of other vectors, as long as the critical dimensions agree. All components of a row vector must be scalars or other row vectors. Similarly, all components of a column vector must be scalars or other column vectors:
Concatenating an empty matrix to a vector has no effect on the resulting vector. The empty matrix is ignored in this case:
Use the isvector
function to tell if a variable holds a vector:
Scalars | Full and Sparse Matrices |
© 1994-2005 The MathWorks, Inc.