为什么我用小数据方法算LE4小时,还看不到图!
数据有2048个!程序有错吗?帮忙看看!谢谢了
function lambda_1=largest_lyapunov_p3(data,N,m,tau,P,delt_t)
%function lambda_1=largest_lyapunov_exponent(data,N,m,tau,P,delt_t)
data=textread('e:/9.txt');
N=length(data);
m=12;
tau=2;
P=10;
delt_t=2;
d_length=[];
d_content=[];
Y=reconstitution(data,N,m,tau);
M=N-(m-1)*tau;
idx_j=0;
for j=1:M
d_min=10000;
for jj=1:M
d_s=0; %寻找相空间中每个点的最近距离点,并记下该点下标
if abs(j-jj)>P %限制短暂分离
d_s=sum(abs(Y(j)-Y(jj)));
if d_s<d_min
d_min=d_s;
idx_j=jj;
end
end
end
if ((M-j)>(M-idx_j));%计算点j的最大演化时间步长i
max_i=M-idx_j;
else
max_i=M-j;
end
d_length=;
for k=1:max_i %计算点j与其最近邻点在i个离散步后的距离
d_j_i=0;
d_j_i=norm(Y(j+k)-Y(idx_j+k));
d_content=;
end
end
%对每个演化时间步长i,求所有的j的lnd(i,j)平均
y=[];
for i=1:max(d_length)
S_j_i=0;
sum_former=0;
Count=0;
for j=1:M
if j==1
former=0;
else
former=d_length(j-1);
end
sum_former=sum_former+former;
if i<=(d_length(j))
if d_content(sum_former+i)~=0
S_j_i=S_j_i+log(d_content(sum_former+i));
Count=Count+1;
end
end
end
y=; %对每个演化时间步长i,求所有的j平均
end
XX=1:length(y);
figure;
plot(XX,y(XX),'-','markersize',1);hold on;%——————————【上面的图是从这儿画出来的】
linear=input('请输入线形部分的长度');
XX1=1:linear;
pp=polyfit(XX1,y(XX1),1);
lambda_1=pp(1)
yp=polyval(pp,XX1);
figure;
plot(XX1,yp,'r--');
页:
[1]