close all;
clear all;

% Malthus model
r = 1.3; % growth rate


% Continuous Malthus Model
x = linspace(0,10,11);
y0 = 1;
y = @(x) y0*exp(r*x);

figure (1);
fplot (y, [0, 2]); 
xlabel('Steps');
ylabel('Population');


% Discrete Malthus Model
y = linspace(0,10,11);
q = zeros(1,11)
q(1) = 1;
for i = 2:11
  q(i) = r*q(i-1);   
end

figure (2);
plot (y,q(:)); 
xlabel('Steps');
ylabel('Population');
