-1

I have a Leslie Matrix

LeslieMatrixA = [0  0.4  0.7  0.5; 
                 x  0    0    0; 
                 0  0.8  0    0; 
                 0  0    0.7  0]

and an initial population vector [10;10;10;10] where 0.7<=x<=0.9.

How can I create MATLAB code to show behaviour of the population over time?

Any help appreciated!

Thanks.

m7913d
  • 10,244
  • 7
  • 28
  • 56

1 Answers1

0

If you just want to show how the population changes you could just plot it right?

x=0.7;
LeslieMatrixA = [0 0.4 0.7 0.5; x 0 0 0; 0 0.8 0 0; 0 0 0.7 0];
P = [10;10;10;10];
for ct = 1:10
    bar([1:4],P)
    title(sprintf('iteration: %.0f',ct))
    pause
    P=LeslieMatrixA*P;
end
Gelliant
  • 1,835
  • 1
  • 11
  • 23