Hi Duncan,
Well, the following is an example, though you will need to modify it so that it will print to a file instead of the console:
pro forum_ex
n=78
m=10000
tstart=findgen(78)*randomu(seed1,10000)
tend =5*findgen(78)*randomu(seed2,10000)
tstart_index=sort(tstart)
tend_index=sort(tend)
timestart=tstart[tstart_index]
timeend=tend[tend_index]
time=randomu(seed,10000)
for i=0, m-1 do begin
for j=0, n-1 do begin
if time[i] LE timeend[j] and time[i] GE timestart[j] then begin
print, '1'
endif else begin
print, '0'
endelse
endfor
endfor
end
|