Databases Reference
In-Depth Information
FIGURE 9.2
The array editor in Matlab.
A column vector is created by separating its elements by semicolons. Thus, the Matlab command
c = [2;0;1] will produce the previous column vector.
The Transpose notation, indicated by a “'”, will convert a row vector into a column vector and
vice versa. Thus, the Matlab command
c = [2,0,1]'
will also produce the earlier-described column vector. Conversely, the Matlab command
c = [2;0;1]' would produce the earlier-described row vector.
Although vectors have a single row or column, matrices have multiple rows and/or columns.
(A vector is also considered a 1
matrix; thus, the term matrix or matrices is also representative
of vectors.) One example of a matrix is
×
n
136
247
987
This matrix is called a 3
3 matrix. It is also a square matrix. A matrix is called square if the
number of rows equals the number of columns. Matrices are always referred to in row-by-column
format. The “3
×
×
3” in the above example stands for 3 rows by 3 columns. Here are two examples
of a 2
×
3 matrix and a 4
×
2 matrix, respectively.
19
82
73
64
721
390
Matrices are written using commas (or spaces) to separate row elements, and semicolons to
indicate the start of a new row. Typical mathematical matrix notation uses a capital boldface letter
to denote a matrix, whereas a vector utilizes a boldface lowercase letter. The Matlab commands to
enter the matrices shown could be
A = [7,2,1; 3,9,0]
B = [1,9;8,2;7,3; 6,4]
or alternatively, using spaces to separate row elements:
A = [7 2 1; 3 9 0]
B = [1 9;8 2;7 3; 6 4]
Notice how the “;” denotes the beginning of a new row.
Search WWH ::




Custom Search