%Purpose: calculate the population change of rabbit
%Author: Jie Zhang
%Date:   Oct. 24, 2013
%Comments: this is for the CDS130 class

clear %clear the workspace 

rabbit(1)=5000;  %the population of rabbit in the first year

%use iternation to calculate the popoluation in the next 20 years
for i=[1:20]
    rabbit(i+1)=rabbit(i)+rabbit(i)*0.20;
end

rabbit  %print the rabbit population

plot(rabbit)  %plot the population

