clear all A=[0 0.0043 0.1132 0; 0.9775 0.9111 0 0; 0 0.0736 0.9534 0; 0 0 0.0452 0.9804] [v lambda]=eig(A) w=v(:,2)/sum(v(:,2)) y=zeros(4,100); %build a matrix to store the population data y(:,1)=[100;100;100;100]; for n=1:99 y(:,n+1)=A*y(:,n); %update with matrix model end plot([1:100],y(1,:),'*r',[1:100],y(2,:),'xb',[1:100],y(3,:),'og',[1:100],y(4,:),'+y') legend('yearling','juveniles','mature female', 'postreproductive female')