我的程序就是这个楼主的程序啊。怎么到我那上边运行的全是0呢?
tau=9;ss=6;
data = [---省略---];
N=length(data);
min_m=2;max_m=9;
for m=min_m:max_m
Y=reconstitution(data,N,m,tau);%reconstitute state space
M=N-(m-1)*tau;%the number of points in state space
for i=1:M-1
for j=i+1:M
d(i,j)=max(abs(Y(:,i)-Y(:,j)));%calculate the distance of each two
end %points in state space 计算状态空间中每两点之间的距离
end
max_d=max(max(d));%the max distance of all points 得到所有点之间的最大距离
d(1,1)=max_d;
min_d=min(min(d));%the min distance of all points 得到所有点间的最短距离
delt=(max_d-min_d)/ss;%the stepsize of r 得到r的步长
for k=1:ss
r=min_d+k*delt;
C(k)=correlation_integral(Y,M,r);%calculate the correlation integral
ln_C(m,k)=log(C(k));%lnC(r)
ln_r(m,k)=log(r);%lnr
fprintf('%d/%d/%d/%d\n',k,ss,m,max_m);
end
plot(ln_r(m,:),ln_C(m,:));
hold on;
end
fid=fopen('lnr.txt','w');
fprintf(fid,'%6.2f %6.2f\n',ln_r);
fclose(fid);
fid=fopen('lnC.txt','w');
fprintf(fid,'%6.2f %6.2f\n',ln_C);
fclose(fid);
请帮忙看看。
谢谢!!! |