Question about storing arrays in pointer array. [message #79507] |
Thu, 08 March 2012 13:42 |
Ian[2]
Messages: 7 Registered: March 2012
|
Junior Member |
|
|
Hello All,
I have a question regarding the storage of arrays within arrays. I am
attempting to read in 14 data files with 5 vectors of 512 elements. I
have attempted two methods:
;test attempting to read in variety of data and overplot it in a stack
;without y-axis and single x-axis
boo=DBLARR(14, 512)
;boo=PTRARR(14)
for x = 0,13,1 do begin
rdcol, 'iz_diff_rot'+STRCOMPRESS(x,/REMOVE_ALL)
+'.dat',p1,p2,p3,p4,p5
print, i, " The dat file is: ", 'iz_diff_rot'+STRCOMPRESS(x,/
REMOVE_ALL)+'.dat'
;attempt 1
;Fills the pointer array with 14 dbl arrays. Use boo=PTR....
; for i=0,13,1 do begin
; boo[i]=PTR_NEW(DBLARR(512))
; p5=boo[i]
; endfor
;endfor
;attempt 2
;Creates two dimensional array of 14 columns with 512 elements. Use
boo=DBL....
for i = 0,13,1 do begin
for j = 0,511,1 do begin
boo[i,j]=p5[j]
endfor
print, boo[i,300]
endfor
endfor
END
Attempt one using the pointer array provides 14 arrays but the values
are all zero, can anybody give a suggestion on how to store the new p5
in boo[i]?
Thanks for your time.
Sincerely
Ian
|
|
|