%
%   LINADEMO_LESSON2.M  MATLAB matrix tasks as part a demo in Lesson 2 Lecture Notes
%
%   This file just does some simple linear algebra manipulations within Matlab.
%   The goal here is to compare with some hand calculations that were done in the 
%   Lecture Notes to confirm our general understanding.
%
%   File prepared by J. R. White, UMass-Lowell (last update: September 2017)
%

      clear all,   close all
      format compact
%
%   define matrices for demo
      disp('Matrices for the demo'),   A = [3 -2 0;-1 3 -2;0 -1 3],   b = [-7 9 -5]'   
%
%   reproduce some of the hand calculations from the notes using Matlab
      disp('Find det A');         det(A)
      disp('Find inverse of A');  AI = inv(A)
      disp('Solve A*x = b using the backslash operator');  x = A\b
      disp('Solve A*x = b using the inverse operator');  x = AI*b
      disp('Find eigenvalues & eigenvector of A');  [evec,eval] = eig(A)
%
%   end of program