用Matlab 绘图

目前混沌算法采用的映射函数有logistic映射、tent映射、cat映射等,它们均可作为混沌序列发生器,每种映射各有特点。将logistic 映射、tent 映射、cat映射分别迭代50000次得到的[0,1]范围内的分布图

第1个回答  2011-10-24
clc;clear
format long g
%cat
N=50000;
X0=[0.1,0.4];%初值
x=zeros(1,N);
y=x;
x(1)=X0(1);
y(1)=X0(2);
for i=1:N-1
x(i+1)=mod(x(i)+y(i),1);
y(i+1)=mod(x(i)+2*y(i),1);
end
[C,xc]=hist(x,100);
subplot(311)
plot(xc,C,'-k.')
title('cat map')

%logistic
N=50000;
x1=[]
x1(1)=0.2;
for i=1:N-1
x1(i+1)=4*x1(i)*(1-x1(i));
end
[C1,xc1]=hist(x1,100);
subplot(312)
plot(xc1,C1,'-g.')
title('logistic map')

%tent
N=50000;
x2=zeros(1,50000);
x2(1)=0.1;
for i=1:N-1
if x2(i)<=0.51 && x2(i)>=0
x2(i+1)=1/0.51*x2(i);
elseif x2(i)<=1 && x2(i)>0.51
x2(i+1)=1/0.51*(1-x2(i));
end
end
[C2,xc2]=hist(x2,100);
subplot(313)
plot(xc2,C2,'-r.')
title('tent map')本回答被提问者采纳
第2个回答  2011-10-25
close all
clear,clc
n=50000;
x=zeros(n+1,1);

%Logistic映射
x(1)=.2;
for i=1:n
x(i+1)=4*x(i)*(1-x(i));
end
[nl,cl]=hist(x,100);
subplot(311)
plot(cl,nl,'k')
title('logistic map')

%tent映射
x(1)=.1;
for i=1:n-1
if x(i)>=0&&x(i)<=0.51
x(i+1)=1/0.51*x(i);
elseif x(i)>0.51&&x(i)<=1
x(i+1)=1/0.51*(1-x(i));
end
end
[nt,ct]=hist(x,100);
subplot(312)
plot(ct,nt,'k')
title('tent map')

%Cat映射
y=x;
x(1)=0.1;
y(1)=0.4;
for i=1:n
x(i+1)=mod(x(i)+y(i),1);
y(i+1)=mod(x(i)+2*y(i),1);
end
[nc,cc]=hist(x,100);
subplot(313)
plot(cc,nc,'k')
title('cat map')
第3个回答  2020-05-08
相似回答