program_2d.m
来自「一个简单的在matlab上实现logistic方程」· M 代码 · 共 28 行
M
28 行
% Chapter 2 - Nonlinear Discrete Dynamical Systems.
% Program 2d - Bifurcation diagram of the logistic map.
% Copyright Birkhauser 2004. Stephen Lynch.
% Plot a bifurcation diagram (Figure 2.15).
% Plot 30 points for each r value.
clear
itermax=100;
finalits=30;finits=itermax-(finalits-1);
for r=0:0.005:4
x=0.4;
xo=x;
for n=2:itermax
xn=r*xo*(1-xo);
x=[x xn];
xo=xn;
end
plot(r*ones(finalits),x(finits:itermax),'.','MarkerSize',1)
hold on
end
fsize=15;
set(gca,'xtick',[0:1:4],'FontSize',fsize)
set(gca,'ytick',[0,0.5,1],'FontSize',fsize)
xlabel('{\mu}','FontSize',fsize)
ylabel('\itx','FontSize',fsize)
hold off
% End of Program 2d.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?