To enter a matrix into Mathematica, you need to use curly brackets, and only curly brackets.  You enter the matrix by rows, with each row in curly brackets.  Below I have entered the matrix (({{1, 2}, {3, 4}})).

matrix1={{1,2}, {3,4}}

You can also use the Pallettes to define a matrix.  If you don’t see any screens off to the right, choose “Basic Math Assistant” from the Pallettes menu above.  Scroll down to Typesetting, and there is a palette for a 2x2 matrix.

(({{\[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder]}}))

If you need to enter a bigger matrix, choose the “Classroom Assistant” palette, and choose the Advanced tab at the top. Click in an input cell, then start clicking “Row+“ and “Col+“ to add rows and columns.

(({{\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \[Placeholder], \[Placeholder], \[Placeholder]}}))

Matrices entered using curly brackets can be a little hard to read, so the MatrixForm command can be helpful.

MatrixForm[matrix1]

I’ll enter another matrix to enable me to demonstrate matrix operations.

matrix2={{-1,3}, {-2,4}}

Adding matrices is as easy as typing a plus sign.

matrix1+matrix2

MatrixForm[%] (*The % give you the previous output.  Typing %n gives you the nth output as numbered on the left. *)

Multiplying matrices takes a bit more care.  You need to be sure to use a period to indicate matrix multiplication, instead of term-by-term multiplication.  Check the computation below to make sure you can do matrix multiplication by hand.

matrix1.matrix2

MatrixForm[matrix1.matrix2]

You can raise a square matrix to a power using the intuitively-named command, MatrixPower.  Let’s raise matrix1 to the 20th power.  We wouldn’t want to do that by hand!  Putting the two backslashes then the command MatrixForm applies the command to the output of the operation.

MatrixPower[matrix1,20] //MatrixForm

Wow.  Those are big numbers!  Glad we had Mathematica to help us out!  Let’s see which other matrix operations we learned in this section can be computed using Mathematica.

Diagonal[matrix1]

IdentityMatrix[3]

MatrixForm[%]

Transpose[matrix1] //MatrixForm

Inverse[matrix1] //MatrixForm

Inverse[matrix1] . matrix1 //MatrixForm

Almost all of them!  And the commands are really easy to remember, too!

We do need to be able to make a zero matrix ourselves, but that’s pretty easy using the Table command.  To make an nxn zero matrix, use the code below.

n=3;
zeromatrix=Table[0, {i,1,n}, {j,1,n}]

MatrixForm[%]

One more thing to notice.  I’ve entered all of my comments in text cells.  Doing so makes certain that your comments cannot be evaluated like functions.  To make a text cell, you can click on the bracket of a cell on the right and type “Alt 7” or from the “Format” menu choose “Style - Text”.  Or under the “Cell” menu choose  “Convert To - Text Display”.  

You should ALWAYS use text cells to enter your comments.