%
% Exercise 8 from Sec 5.1
% Matlab/Octave: zeros(m,n) returns m-by-n matrix of zeros
%
A = [1 2 2; 3 -2 1; 0 1 1]
rank(A - 3 * eye(3))
zeros(3,1)
C = [(A - 3 * eye(3)) zeros(3,1)]
rref(C)
[X,D] = eig(A)
X(:,2)
X(3,2) * [3 2 1]'

%
% Exercise 14 from Sec 5.1
%
A = [1 0 -1; 1 -3 0; 4 -13 1]
C = [(A - (-2) * eye(3)) zeros(3,1)]
rref(C)
[X,D] = eig(A)
X(:,1)
X(3,1) * [1/3 1/3 1]'

%
% Exercise 16 from Sec 5.1
%
A = [3 0 2 0; 1 3 1 0; 0 1 1 0; 0 0 0 4]
C = [(A - 4 * eye(4)) zeros(4,1)]
rref(C)
[X,D] = eig(A)
X(:,1)
X(3,1) * [2 3 1 0]'
X(:,4)
[0 0 0 1]'
