
% Illustrate a few things for a real or complex matrix...

caseno = 1   % set to 1 or 2

switch caseno
    case 1,
       A = [1,2,1; 2,4,1; 3,6,1; 4,8,1];
    case 2,
       A = [1+1j, 1; 2+2j, 2; 3+3j, 3];
    end

% print A:
A

disp('The adjoint of A is:')
A'

disp('The matrix (adjoint of A) * A is:')
A'*A

rankA = rank(A);
disp(sprintf('The rank of A is %g', rankA))

disp('Basis for the null space of A:')
null(A, 'r')     % 'r' means make rational

x = ans          % results of previous command
disp('b = A*x:')
b = A*x          % * is matrix multiplication!

disp(sprintf('2-norm of A is %g', norm(A)))
disp(sprintf('1-norm of A is %g', norm(A,1)))
disp(sprintf('max-norm of A is %g', norm(A,inf)))


