function [P]=populacao(R,P0,cor) P(1)=P0; S(1)=P0;
r = R-1; for n=1:200; P(n+1)=R*P(n); S(n+1)=P0*exp(r*(n)) end plot(P,cor) plot(S,'+-') endfunction