全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
3243 3
2007-12-06

请教高手 我这个程序运行出现点问题 ,哪位高手帮忙解决一下?谢谢

function[vmrs,VERS,H,C,R]=RS2(vector)
%this program makes use of the classical R/S method.
N=length(vector);
n=5;
vmrs=[];
%the vector vmrs is used to save the log of the mean value of R/S.
h=[];
%this vector is used to save the log value of length n.
VRS=[];
%it represents V-statistic
while n<N
a=floor(N/n);
s=0;
for i=1:a;
v1=zeros(n,1);
vl=vector(n*(i-1)+1:n*(i-1)+n);
m=mean(v1);
%find the mean value of the I-th sub-vector.
v2=v1-m;
v3=cumsum(v2);
%the cumulative deviations from mean of the I-th sub-vector.
r=max(v3)-min(v3)
%range calculation.;
sig=std(v1,1);
%sample standard deviations normalized by n.
rs=r/sig;
s=s+rs;
%the sum of rescaled range for‘a’sub-vectors correspond to the
%length n of subvector.
end
mrs=s/a;
vmrs=[vmrs;log10(mrs)];
h=[h;log10(n)];
VRS=[VRS;mrs/sqrt(n)];
n=n+1;
end
figure(1);
[H,C,R]=postreg(vmrs','h');
%to make use of BP network to make regression about‘vmrs’versus‘h’
figure(2)'
plot(h,vmrs,'*')
hold on;
y=C+H*h;
plot(h.y,'r-');
hold on;
polt(h,VRS,'r');
disp(VRS');
figure(3);
plot(h,vmrs,'*')
Cn=2^(2*H-1)-1;
disp('the correlation funtion Cm=');
disp(Cn);

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-12-9 10:10:00
怎么没有人回答啊?唉
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-1-6 23:07:00

哈哈哈,这个程序,我见过啊.你把第一行function[vmrs,VERS,H,C,R]=RS2(vector)
%this program makes use of the classical R/S method.

新建一个m文件,其他的在另一个m文件就可以了.如果提示没有定义,你就把那个行删掉.就ok了.我运行过的.我也在做分形.zhaohongbao0416@sina.com

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-8-28 11:44:09
function[vmrs,VRS,H,C,R]=RS2(vector),把函数改为这个就没有问题了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群