急救阿,看看问题出在那,作业啊回不了家了
数据:data :527
1160
706
1760
2340
1110
732
537
522
880
654
1040
370
2220
980
285
184
1060
402
350
641
364
152
464
532
600
446
765
506
840
635
590
1050
838
1280
480
3200
2200
781
1640
578
643
652
220
1270
561
1620
770
717
972
104
694
742
344
948
109
程序:
clc
clear all
close all
%--------------------------------------------------------------------------
data = load('d:\c.txt');
% 时间序列(列向量)
%--------------------------------------------------------------------------
%-----------------------------------------------------------------
%计算参数
N=length(data);
% 时间系列长度
tau =10;
% 时间延迟
min_m= 4;
% 最小嵌入维
max_m=10;
% 最大嵌入维
ss = 11;
% 计算r的步长
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)
出错:??? One or more output arguments not assigned during call to 'D:\matlab\work\reconstitution.m (reconstitution)'.
Error in ==> G_P at 12
Y=reconstitution(data,N,m,tau);%reconstitute state space
怎么解决阿
页:
[1]