#pragma rtGlobals=1 // Use modern global access method. function load_DLS_ALV_New() variable i=0 variable /G points string wnameIACF, fname, wnameTau, wnameEACF, wStr, wnameParam, mystring string Tau = "_Tau", EACF="_EACF", IACF="_IACF", Param="_Param" //wave names getfilefolderinfo/D newpath/O cgms S_path string filelist= indexedfile(cgms,-1,".asc") Display/W=(0,0,340,280); Display/W=(440,0,780,280); do fname = stringfromlist(i,filelist) wnameTau = fname[0,strlen(fname)-5]+Tau wnameIACF = fname[0,strlen(fname)-5]+IACF wnameParam = fname[0,strlen(fname)-5]+Param wnameEACF = fname[0,strlen(fname)-5]+EACF wave w0 = $wnameTau wave w1 = $wnameIACF wave w2 = $wnameParam wave w3 = $wnameEACF //print num2str(round(10*w2[4])/10) if (!waveexists(w)) LoadWave/J/D/A=wave/P=cgms/K=0 /L={0,27,231,0,1} stringfromlist(i,filelist) LoadWave/J/D/A=wave/P=cgms/K=0 /L={0,27,231,1,1} stringfromlist(i,filelist) LoadWave/J/D/A=wave/P=cgms/K=0 /L={0,14,10,1,1} stringfromlist(i,filelist) //Calculate EACFs Duplicate/O wave1 wave3 wave3/=mean(wave1,20,40) //Do calculation //print wave3 rename wave0 $wnameTau rename wave1 $wnameIACF rename wave2 $wnameParam rename wave3 $wnameEACF AppendToGraph/W=Graph0 $wnameIACF vs $wnameTau AppendToGraph/W=Graph1 $wnameEACF vs $wnameTau else print fname+" was previously loaded. Its corresponding wave exists." endif i += 1 //move to next file print i while(i