program_7b.m

来自「《Dynamical Systems with Applications usi」· M 代码 · 共 21 行

M
21
字号
% Chapter 7 - Differential Equations.
% Program_7b - Solution curves, initial value problem.
% Copyright Birkhauser 2004. Stephen Lynch.

% Solve the differential equation and plot 2 solution curves.
clear
deqn1=inline('P(1)*(100-P(1))/1000','t','P');
[t,P1]=ode45(deqn1,[0 100],50);
[t1,P2]=ode45(deqn1,[0 100],150);
hold on
plot(t,P1(:,1))
plot(t1,P2(:,1))
axis([0 100 0 200])
fsize=15;
set(gca,'xtick',[0:20:100],'FontSize',fsize)
set(gca,'ytick',[0:50:200],'FontSize',fsize)
xlabel('t','FontSize',fsize)
ylabel('P','FontSize',fsize)
hold off

% End of Program_7b.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?