% Linear Algebra: Theory and Applications
% Ward Cheney & David Kincaid
% JBPub.com (c) 2008 
% File: exp832.m
% Example 8.3.2

B = [0.0,0.15,0.1; 0.15,0.0,0.05; 0.1,0.05,0.0]
c = [3.5; 2.5; 1.5]
x = [0.0; 0.0; 0.0]
z = [0,x']
for k=1:25
  x = B*x + c;
  z = [k,x']
end

pause
x1 = 0.0; x2 = 0.0; x3 = 0.0;
z = [0,x1, x2, x3]
for k=1:25
   y1 = 0.15*x2 + 0.1*x3 + 3.5;
   y2 = 0.15*x1 + 0.05*x3 + 2.5;
   y3 = 0.1*x1 - 0.05*x2 + 1.5;
   x1 = y1; x2 = y2; x3 = y3;
    z = [k,x1,x2,x3]
end

