Creating a Matrix
a= {{1, -1, 1}, {2, 0, 1}, {3, -1, 2}}In order to see your matrix in the usual form, use the command MatrixForm. Note that Mathematica is CASE SENSITIVE, that is, the upper and lower case letters must be entered as shown.
MatrixForm[a]
Simplify[%]
b={{b11, b12, b13, b14},{b21, b22, b23, b24},{b31, b32, b33, b34},
{b41, b42, b43, b44}}
MatrixForm[b]
Special matrices can also be entered. A diagonal matrix is a matrix where only the diagonal is non-zero. An identity matrix is the diagonal matrix with diagonal consisting of all 1's. An upper triangular matrix is a matrix whose nonzero entries lie above the diagonal. A lower triangular matrix is a matrix whose non-zero entries lie below the diagonal. The superdiagonal is the collection ai,i+1, the diagonal "directly above" the diagonal. A row vector is a 1xn matrix. A column vector is an mx1 matrix. Note the following examples.
DiagonalMatrix[{2, -3, 5}]
MatrixForm[%]
The [%] applies the MatrixForm function to the previous calculation.
Table[If[i>=j, 1, 0], {i,5}, {j, 5}]
MatrixForm[%]
Table[If[i<=j, 1, 0], {i,5}, {j, 5}]
MatrixForm[%]
MatrixForm[IdentityMatrix[3]]
MatrixForm[IdentityMatrix[2]]