Home > Back-end >  Leslie model appeared in the process of MATLAB programming to solve:
Leslie model appeared in the process of MATLAB programming to solve:

Time:11-10

Wrong use of dot matrix dimensions must be consistent to do

CodePudding user response:

N=[371 346 326 348 481 635 502 477 576 609 514 378 392 275 186 139 91 43 14 3];
NO=N ';
A=eye (20);
B=[0.99925 0.099985 0.99986 0.99982 0.99983 0.99979 0.99969 0.99948 0.9992 0.99875 0.99822 0.99669 0.99494 0.9912 0.98419 0.97045 0.94792 0.91737 0.86924 0.81529];
For I=1:
A (I, :)=A (I, :) * b (1, I);
End
A;
C=[0 0 0 0.00919 0.05496 0.07431 0.04531 0.0186 0.00537 0.00311 0 0 0 0 0 0 0 0 0 0];
D=zeros (21, 1);
B=[c] A;
L=(B, d),
For I=0:32
H=L ^ i. * NO;
Q (1, I + 1)=sum (H ((1:15), :));
P (1, I + 1)=sum (H ([I] 1, :));
End
X=2018, 2050;
Y1=Q * 10;
Y2=P * 10;
Plot (x, y1, '*')
Plot (x, y2, '-' or ')
grid on

CodePudding user response:

Incorrect use. *
Matrix dimensions must be consistent,

Error lesliegenianlingduanrenshu (line 14)
H=L ^ i. * NO;

>
  • Related