%Purpose: make a plot
%Author: Jie Zhang
%Date:   Oct. 29, 2013
%Comments: this is for the CDS130 class

clear;clc

rate = 0.15;
P(1) = 1000;

for t = [1:19]
   P(t+1) = P(t)+rate*P(t);
end

figure(1)
plot(P,'-*r')

title('Bank account balance', ...
   'FontName', 'Arial', ...
   'FontSize', 12, ...
   'FontWeight', 'Bold')
xlabel('Years')
ylabel('Dollars in account')
xlim([1 21])
ylim([1000 16000])
text(4,8000,'Interest rate = 15%', ...
   'FontName','Arial','FontSize',14)

    