3.7.1 Constructing Matrices
Functions for constructing matrices. This generates a matrix whose  entry is a[i, j].
Out[1]= |  |
Here is another way to produce the same matrix.
Out[2]= |  |
DiagonalMatrix makes a matrix with zeros everywhere except on the leading diagonal.
Out[3]= |  |
IdentityMatrix[n] produces an identity matrix.
Out[4]= |  |
Of the functions for constructing matrices mentioned above, Table is the most general. You can use Table to produce many kinds of matrices.
Some special types of matrices. Table evaluates Random[ ] separately for each element, to give a different pseudorandom number in each case.
Out[5]= |  |
This gives a tridiagonal matrix.
Out[6]= |  |
MatrixForm prints the matrix in a two-dimensional array, and makes the structure in this case clearer. Out[7]//MatrixForm=
 |
|