% some matlab commands for matrices...if you want more just use google.

% enter a matrix row by row, each row terminates with ";"
A=[1 2 3; 4 5 6]   %use spaces or commas to separate row entries
AA=[3 5 9;2 4 6];  %if you put a semi-colon at the end the computation
                   %isn't echoed in the command window.

%rref computes reduced row echelon form.  I named the result 
% with an equals sign and a name, so
%that it would be saved to my workspace after running the script

B=rref(A)

% augmenting a matrix, either by rows or columns:  first by row

b=[1,0,0]   %row vector .. 
C=[A;b]  % add a 3rd row to A, using b
          % use semicolons to separate rows
D=rref(C) % the 3 by 3 matrix D is invertible, since D is the identity
E=C^(-1)  % inverse matrix...everything is decimals

F= C*E  % this is how you multiply matrices!  should get identity

% augmenting a matrix by columns

g=[-1;3] % a column vector with two entries
H=[A,g] % augment A with the column g
K=rref(H) %reduce the augmented matrix to find solutions to Ax=g

% eigenvalues and eigenvectors

L=[2,1,0;0,2,0;0,0,3]
lambda=eig(L)  % eigenvalues
[M,N]=eig(L)  % eigenvalues in first diagonal matrix, 
              %eigenvectors in second matrix
              % note that this matrix is not diagonalizable





