clear all A=[0 0 0 0 127 4 80; 0.6747 0.737 0 0 0 0 0; 0 0.0486 0.6610 0 0 0 0; 0 0 0.0147 0.6907 0 0 0; 0 0 0 0.0518 0 0 0; 0 0 0 0 0.8091 0 0; 0 0 0 0 0 0.8091 0.8089] [v lambda]=eig(A) %w=v(:,7)/sum(v(:,7)) y=zeros(7,50); %build a matrix to store the population data y(:,1)=[1000;0;0;1000;1000;1000;0]; for n=1:49 y(:,n+1)=A*y(:,n); %update with matrix model end plot([1:50],y(1,:),'*r',[1:50],y(2,:),'xb',[1:50],y(3,:),'og') legend('eggs','small juveniles','large juveniles')