第四次作业
1.
2
3.
源代码:
clear;
clc;
%%………………Logisc 映射……………………
n=1000; %迭代次数
x=linspace(0,1,1000);%初值
xN=length(x);
r=linspace(2,4,2000);%分形参数
rN=length(r);
Y=zeros(xN,rN);
for j=1:rN
for i=1:xN
Y(i,j)=r(j)*x(i)*(1-x(i));
for m=1:n
Y(i,j)=r(j)*Y(i,j)*(1-Y(i,j));
end
end
end
plot(r,Y,’k’)
源代码:
clear;
clc;
%%………………tent 映射……………………
n=1000; %迭代次数
x=linspace(0,1,1100);%初值
xN=length(x);
a=linspace(1,2,1000);%分形参数
aN=length(a);
Y=zeros(xN,aN);
for j=1:aN
for i=1:xN
for m=1:n
if x(i)<=0.5
x(i)=a(j)*x(i);
else
x(i)=a(j)*(1-x(i));
end
end
Y(i,j)=x(i);
end
end
plot(a,Y,’k’);