% hw0115.m
% John Burkardt
% Every year, 30% of Californians move out, 10% of US moves in.
%
fprintf ( '\n' )
fprintf ( 'Model California Population 1960-1980.\n' )
fprintf ( '\n' )
usnew = 164;
canew = 16;
for y = 1960 : 1980
  caold = canew;
  usold = usnew;
  canew = caold - 0.3 * caold + 0.1 * usold;
  usnew = usold + 0.3 * caold - 0.1 * usold;

  fprintf ( '  %d  %g  %g\n', y, canew, usnew );
end

