公式:
figure1 = figure;
annotation1 = annotation(figure1,'arrow',[0.131 0.131],[0.92 0.96]);
annotation2 = annotation(figure1,'arrow',[0.88 0.96],[0.108 0.108]);
x=0.1*ones(1,1000);
u=4;
for n=1:1000
x(n+1)=u*x(n)*(1-x(n));
end
plot(x(1,:),'o','markersize',2,'MarkerFace','b');
axis([0 1000 0 1]);
title('Logistic Map');
xlabel('迭代次数n');
ylabel('X(n)');
结果:
figure1 = figure;
annotation1 = annotation(figure1,'arrow',[0.131 0.131],[0.92 0.96]);
annotation2 = annotation(figure1,'arrow',[0.88 0.96],[0.108 0.108]);
x=0.1*ones(1,1000);
u=3.75;
for n=1:1000
x(n+1)=u*x(n)*(1-x(n));
end
plot(x(1,:),'o','markersize',2,'MarkerFace','b');
axis([0 1000 0 1]);
title('Logistic Map');
xlabel('迭代次数n');
ylabel('X(n)');
结果:
x=0.1;
u=2:0.001:4;
for i=1:2000
x=u.*x.*(1-x);
if i>=1800
plot(u,x);
title('Logistic Map');
xlabel('μ');
ylabel('X(n)');
hold on;
end
end
结果: