声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2175|回复: 4

[分形与混沌] C-C法运行的问题

[复制链接]
发表于 2010-9-10 21:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本帖最后由 cqupenghao 于 2010-9-10 21:09 编辑

我的程序如下,可是在运行后却会出现问题,运行不下去
最后出现问题

function [s,delt_s,s_cor]=C_CMethod(data)
%this function calculate time delay and embedding demension with C-C
%Method,which proved by H.S.Kim
%skyhawk&flyinghawk
% %****************调试程序段****************************
% clear all;
% data=load('f:/sunpot/year sunpot number.txt');
% %************************************************
data=[0.618000000000000;-0.274344400000000;-0.856996785358416;0.395442631217852;-0.702887738289454;-0.0613027719884378;-0.992859743278414;0.872963892663468;0.447925319998893;-0.618789524637389;-0.272489095978165;-0.858924415888705;0.401727189198530;-0.693369004371432;-0.0865549051762413;-0.985765671940871;0.846294523956369;0.360807400429219;-0.752654237611467;0.0763279626495470;-0.988930680023762;0.858169390795294;0.399263936266136;-0.697117787474815;-0.0766509017338150;-0.988836814600447;0.857816667227401;0.398113925688939;-0.698860074127830;-0.0720297339010833;-0.990142263124864;0.862725232329453;0.414160170346028;-0.674095571268004;-0.136630805514041;-0.964530843670710;0.767607521945051;0.119520484718582;-0.972858222092007;0.798260928554839;0.210718969108745;-0.915635280509720;0.592937137136817;-0.332008547667591;-0.790563616123749;0.187482579163449;-0.933215536769420;0.654693352328889;-0.185615567391085;-0.934539036169962;0.659390099238416;-0.173888924350068;-0.942549019777915;0.687957443900185;-0.100757655226415;-0.980711000335222;0.827408725739173;0.300749878915712;-0.828144069631151;0.303062940123966;-0.825490423214494;0.294725433755803;-0.834960145525162;0.324601044769259;-0.799804907295940;0.215406990495868;-0.911839674046475;0.579758023213845;-0.361373205586433;-0.751877871939953;0.0741086351946088;-0.989565029360226;0.860553999932137;0.407051054918482;-0.685187933510526;-0.107983241965991;-0.977845276963577;0.816744632791951;0.267436410869473;-0.864107755668383;0.418696205471876;-0.666917626294560;-0.154919671501495;-0.954399801225551;0.730670063100804;0.0143696081122933;-0.999607677289128;0.898509466141196;0.533906595416139;-0.458393120005179;-0.600763920310643;-0.314257152900676;-0.812360639516446;0.253866636407581;-0.877548288746292;0.463172898254935;-0.592394646012035;-0.333230308414923;-0.789019366952021;0.182847966708198;-0.936476580034288;0.666277931410160;-0.156540064420016;-0.953440895639617;0.727194128808343;0.00474147184931617;-0.999957285044934;0.899837686637428;0.538444938356695;-0.449146391880305;-0.616708285455717;-0.277374692235514;-0.853820232203783;0.385117078948991;-0.718201187453414;-0.0199554032469628;-0.999243385574377;0.897125952866872;0.529186453083857;-0.467927225957801;-0.583983811294130;-0.352029525478126;-0.764542905064126;0.110599121999397;-0.976758885004629;0.812710046927422;0.254945478715867;-0.876505325476441;0.459697012618268;-0.598489447520697;-0.319439724292106;-0.806120698833949;0.234678104068215;-0.895359756194802;0.523171276725108;-0.479954448898660;-0.562323081266529;-0.399206229322341;-0.697205334293453;-0.0764189714822344;-0.988904267515435;0.858070135589455;0.398940279421960;-0.697608641563985;-0.0753501481089789;-0.989212474841914;0.859228508727444;0.402719897398975;-0.691851700054022;-0.0905483277514843;-0.984421900648679;0.841264309105838;0.344678711773114;-0.774273512735811;0.139048997796078;-0.963264214802622;0.762968100286692;0.106028611904658;-0.978640073569386;0.819699147832196;0.276622716617973;-0.854611758036696;0.387686388251688;-0.714428602292287;-0.0302243672307090;-0.998264326488456;0.893410164524957;0.516545271945370;-0.493043865858680;-0.538124718044343;-0.449801396876423;-0.615589536399236;-0.279994093083970;-0.851046284892361;0.376131580155271;-0.731197565378807;0.0158347712702012;-0.999523594035759;0.898190088564904;0.532816326872838;-0.460602847453700;-0.596905532143332;-0.323037192823702;-0.801729246899906;0.221262592135913;-0.906981444110464;0.562969145925334;-0.397824907398589;-0.699297151801277;-0.0708686376169807;-0.990457508784395;0.863911545744040;0.418052001852727;-0.667941795119162;-0.152322140832684;-0.955916134283081;0.736173745987148;0.0297083901334236;-0.998323081955793;0.893633054334853;0.517302068019693;-0.491557283802844;-0.540905729806704;-0.444099883778325;-0.625273057133348;-0.257163847643922;-0.874346835383450;0.452516538235601;-0.610934686984209;-0.290841735655062;-0.839281061122187;0.338346129160929;-0.782491604075450;0.163356909852284;-0.949297588006674;0.712215230131049;-0.0362239853418153;-0.997506863483316;0.890537891123014;0.506809697499069;-0.511973467989714;-0.501978019341712;-0.521234329385767;-0.483798070352563;-0.555284911533959;-0.414151467343175;-0.674109267985241;-0.136595720151164;-0.964549057549131;0.767674280395942;0.119715221484713;-0.972769704915246;0.797933707721700;0.209726583645147;-0.916428044213817;0.595696684420967;-0.325776374322748;-0.798352532472938;0.210996855601311;-0.915412621160083;0.592162507260431;-0.333752773490576;-0.788357263755962;0.180863633101896;-0.937847857820247;0.671161348394251;-0.144130644401060;-0.960530078954617;0.752974261895468;0.0772434542463478;-0.988663552674576;0.857165678735515;0.395992701524020;-0.702060582645446;-0.0635107827615207;-0.992336122898736;0.870988863538421;0.441381040775105;-0.629847276004142;-0.246255576929308;-0.884780562579306;0.487389623444492;-0.548657574421408;-0.428052245457032;-0.651865422802467;-0.192635794053666;-0.929493756613696;0.641521422809296;-0.218055501745800;-0.909658416500936;0.572209025950881;-0.377895978178654;-0.728669796385157;0.00882337711157444;-0.999852081231059;0.899437950249953;0.537078390064690;-0.451938925558489;-0.611927294373573;-0.288535474161214;-0.841819832286071;0.346455197057281;-0.771940713220801;0.132195682982894;-0.966796172661304;0.775920194997836;0.143899083110412;-0.960656802371967;0.753436834692712;0.0785674213563676;-0.988271604572681;0.855693452368857;0.391201440411172;-0.709226722738426;-0.0442951659320526;-0.996272082722599;0.885860319343607;0.491022160236357;-0.541904752497960;-0.442044554518237;-0.628733562459469;-0.248918804130347;-0.882274915005604;0.478977148731477;-0.564103692886823;-0.395395344975754;-0.702958790225859;-0.0611129845639753;-0.992903885923598;0.873130440696146;0.448477856293467;-0.617848463587391;-0.274700224481130;-0.856625594673032;0.394234077952959;-0.704701034383102;-0.0564532590648332;-0.993944756127822;0.877059738644590;0.461544191787503;-0.595256222151720;-0.326773056980359;-0.797116801540251;0.207250871065744;-0.918389445240731;0.602534428946199;-0.310209297675508;-0.817163364107769;0.268736330915860;-0.862783490447174;0.414351167637598;-0.673794908766983;-0.137400799747416;-0.964129938434664;0.766138422553454;0.115239356774120;-0.974767792235545;0.805327272681543;0.232248830636915;-0.897514913268792;0.530512737125786;-0.465256847919882;-0.588718524380946;-0.341479948196371;-0.778443745461627;0.151351863211820;-0.956475965654390;0.738207918461546;0.0354067686707249;-0.997618085391366;0.890959504169875;0.508236792334197;-0.509221189543908;-0.507318182227025;-0.510993697765547;-0.503882337603396;-0.517594920717541;-0.490981446290065;-0.541980716857940;-0.441888114852891;-0.628996298508341;-0.248290947279332;-0.882868050448351;0.480966389554695;-0.560475531025570;-0.403147640331049;-0.691196762181463;-0.0922693683047381;-0.983824090978025;0.839028699778600;0.337541402199118;-0.783525023422761;0.166431778426313;-0.947370879946724;0.705272009924957;-0.0549236448311817;-0.994268447153071;0.878282515507939;0.465622336389210;-0.588072095725361;-0.342925299435445;-0.776564254113510;0.145798877457057;-0.959611105931298;0.749621601790708;0.0676718371554075;-0.991298992666423;0.867080016436783;0.428472734317621;-0.651181120298124;-0.194329982277832;-0.928248130177005;0.637124723236502;-0.228736965377540;-0.900590861272761;0.541021408875226;-0.443862086763465;-0.625674251074566;-0.256210289930334;-0.875276945934247;0.455608490959566;-0.605599715634539;-0.303173070404395;-0.825363569824986;0.294327542549066;-0.835405465624353;0.326014354790579;-0.798057816893917;0.210102930300419;-0.916127841490437;0.594651421712460;-0.328140404645165;-0.795415362194684;0.202102636989071;-0.922393595831921;0.616538896700308;-0.277771598825577;-0.853401583883178;0.383759100411201;-0.720185010418013;-0.0145337464614932;-0.999598663406207;0.898475226978602;0.533789693639077;-0.458630269632931;-0.600350723975207;-0.315200115622645;-0.811232885511795;0.250387709618008;-0.880881390257272;0.474308845033009;-0.572559127094560;-0.377134487363359;-0.729762199038236;0.0118504475757302;-0.999733177095284;0.898986208231559;0.535534784922056;-0.455084738863125;-0.606505972862374;-0.301085959276304;-0.827759765740669;0.301853836580188;-0.826880096549460;0.299088318732325;-0.830037737435956;0.309029026578821;-0.818552015390319;0.273052063609150;-0.858340884061691;0.399823239178431;-0.696268617084448;-0.0788990244402894;-0.988172393490504;0.855320890587828;0.389990269164316;-0.711024420918575;-0.0394441184290710;-0.997043906890572;0.888783449308468;0.500878437552850;-0.523329502509770;-0.479639840425465;-0.562896684605605;-0.397979912674034;-0.699062779305139;-0.0714913381213309;-0.990289078289881;0.863277671302421;0.415971841761730;-0.671238111036574;-0.143934856754899;-0.960637238320799;0.753365416932361;0.0783629577163736;-0.988332569030090;0.855922407310671;0.391946017939340;-0.708118806140840;-0.0472787371403756;-0.995752969927381;0.883895556526481;0.484415574209789;-0.554148947779702;-0.416545992981834;-0.670329927888478;-0.146249796776354;-0.959360894191463;0.748709318077301;0.0650747216539758;-0.991954033143149;0.869548327351025;0.436617157838033;-0.637794369214732;-0.227114850936165;-0.901995804520062;0.545833219606410;-0.433925583110791;-0.642246317811724;-0.216287367788837;-0.911117571616455;];
N=length(data);
max_d=20;%the maximum value of the time delay

sigma=std(data);%calcute standard deviation s_d

for t=1:max_d
    t
    s_t=0;
    delt_s_s=0;
    for m=2:5
        s_t1=0;
        for j=1:4
            r=sigma*j/2;
            data_d=disjoint(data,N,t);%将时间序列分解成t个不相交的时间序列
            [ll,N_d]=size(data_d);
            s_t3=0;
            for i=1:t
                i
                Y=data_d(i,:);
                C_1(i)=correlation_integral(Y,N_d,r);%计算C(1,N_d,r,t)
                X=reconstitution(Y,N_d,m,t);%相空间重构
                N_r=N_d-(m-1)*t;
                C_I(i)=correlation_integral(X,N_r,r);%计算C(m,N_r,r,t)
                s_t3=s_t3+(C_I(i)-C_1(i)^m);%对t个不相关的时间序列求和
            end
            s_t2(j)=s_t3/t;
            s_t1=s_t1+s_t2(j);%对rj求和
        end
        delt_s_m(m)=max(s_t2)-min(s_t2);%求delt S(m,t)
        delt_s_s=delt_s_s+delt_s_m(m);%delt S(m,t)对m求和
        s_t0(m)=s_t1;
        s_t=s_t+s_t0(m);%S对m求和
    end
    s(t)=s_t/16;
    delt_s(t)=delt_s_s/4;
    s_cor(t)=delt_s(t)+abs(s(t));
   
end
fid=fopen('result.txt','w');
fprintf(fid,'%f %f %f %f/n',t,s(t),delt_s(t),s_cor(t));
fclose(fid);
t=1:max_d;
plot(t,s,t,delt_s,'.',t,s_cor,'*')
        
  
10


i =

    11


i =

    12


i =

     1

Error in ==> reconstitution at 9
M=N-(m-1)*tau;%相空间中点的个数

??? Output argument "X" (and maybe others) not assigned during call to "C:\Users\彭浩\Documents\MATLAB\Chaos Toolbox Ver.2.0\Chaos
Toolbox Ver.2.0\Main\reconstitution.m (reconstitution)".

Error in ==> C_CMethod at 30
                X=reconstitution(Y,N_d,m,t);%相空间重构
            
回复
分享到:

使用道具 举报

发表于 2010-10-12 16:55 | 显示全部楼层
遇到了相似的问题,同等高手
发表于 2010-10-14 20:49 | 显示全部楼层
看提示应该是reconstitution.m文件的问题,能否把它的代码贴出来
 楼主| 发表于 2010-10-15 12:44 | 显示全部楼层
回复 zhengxincool88 的帖子

现在知道问题出在哪了,并且已经解决了,谢谢
发表于 2010-10-15 14:17 | 显示全部楼层
建议解决问题后回帖说明一下原因及解决办法,以便后来者参考
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-13 12:51 , Processed in 0.068971 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表