In the next few homework sets, I will allow you to do some matrix calculations using a calculator, Mathematica, or matlab.
In particular, you may compute eigenvalues and reduce a matrix to reduced row echelon form.   I prefer that you do not compute the eigenvectors with the computer. 
You may also compute the inverse of a matrix with the computer.

In Mathematica, you define a matrix row by row.

A = {{0, 1, 0},{0,0,1},{2,-5, 4}}  (* note curly brackets *)

MatrixForm[A]  (* This gives display in form we like *)

Eigenvalues[A]

We can get an eigenvector v2 for eigenvalue 2 using ...

MatrixForm@RowReduce[A - 2 IdentityMatrix[3]]

v2 = {0, 0, 0} (* Change this!  v2 cannot be 0 *)
A.v2  (* check, this should be 2 v2 *)

We can get an eigenvector for 1 using ...

MatrixForm@RowReduce[A -  IdentityMatrix[3]]

We can get the generalized eigenvectors for 1 using ...

A1 = A - IdentityMatrix[3]

Here is a cell with some examples of how and how not to do matrix multiplication.

MatrixForm[A1]
MatrixForm[A1.A1]  (* what we want for matrix multiplication *)
MatrixForm[MatrixPower[A1,2]] (* another way to write this *)
MatrixForm[A1*A1]  (* multiplies pointwise.  Not very usefull *)
MatrixForm[A1^2]   (*This also isn't what we want *)

Avoid this common mistake:

A1bad = MatrixForm[A - IdentityMatrix[3] ]
A1bad.A1bad  (* This doesn't actually do the matrix multiplication &)

So finally, we can find the generalized eigenvectors for eigenvalue 1 using ...

MatrixForm@RowReduce[A1.A1]

diag = DiagonalMatrix[{1,1,2}];
MatrixForm[diag]

v2 = {1,2,4}; (* and eigenvector for lam = 2 *)
A.v2  (* check *)

Find two generalized eigenvectors for lam = 1, and use Perko’s theorem 1 to find the S + N decomposition of A.

v11= {1,1,1};  (* change this! *)
v12 = {2,2,2}; (* change this! *)
P = Transpose[{v11, v12, v2}];
MatrixForm[P]

Warning!  You cannot use “N” for a matrix, since it is reserved for “Numerical”.  Use Nil instead: A = S + Nil
These single capital letters are reserved in Mathematica and cannot be used as variables: D E I N   (I deign not use them.)

Pi
N[Pi]
N = {1,2}  (* This does not actually define the variable N *)
N