Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Liniowy model wzrostu – czas dyskretny
- a1=1.2
- a2=1
- a3=0.8
- start=1 %wartosć początkowa
- z=10 % ilość czasu
- x=0:1:z
- y1=x
- y2=x
- y3=x
- y1(1)=start
- y2(1)=start
- y3(1)=start
- for i=2:(z+1)
- y1(i)=y1(i-1)*a1
- y2(i)=y2(i-1)*a2
- y3(i)=y3(i-1)*a3
- end
- % hold on
- %plot(x,y1,x,y2,x,y3)
- %hold off
- figure
- hold on
- stem(x,y1)
- stem(x,y2,':diamondr')
- stem(x,y3,'filled')
- hold off
- %Liniowy model wzrostu – czas ciągły
- b1=2
- b2=0
- b3=-2
- start=1 %wartosć początkowa
- z=1 % ilość czasu
- x1=0:0.01:z
- y1_1=x1
- y2_1=x1
- y3_1=x1
- y1_1(1)=start
- y2_1(1)=start
- y3_1(1)=start
- for i =2:length(x1)
- y1_1(i)=start*exp(b1*x1(i))
- y2_1(i)=start*exp(b2*x1(i))
- y3_1(i)=start*exp(b3*x1(i))
- end
- figure
- plot(x1,y1_1,x1,y2_1,x1,_y3_1)
- grid on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement