comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: printing an array from pointers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: printing an array from pointers [message #48121 is a reply to message #48093] Tue, 28 March 2006 05:30 Go to previous messageGo to previous message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Hi Eli,

if your goal really is to just create the 10x8 array via the loop and
then print the complete array, I wouldn't use pointers. A simple

arr = fltarr(10,8)
for i = 0,9 do begin
...
arr[i,*] = (some 1 by 8 vector)
endfor

print, arr

will do the trick.

If you _really_ want to use the pointer array, you have to manually
concatenate the individual vectors like

print, transpose([[*ptr[0]], [*ptr[1]], ..., [*ptr[9]]])

which is far from being elegant and most likely will waste some memory.
Not really a problem with 10x8 entries, but there is probably more to
come?

While you think over it, why not completely re-thinking the problem and
trying to avoid the for-loop at all :-) ?

Cheers,

Peter
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: What is the algorithms of sort function and where function?
Next Topic: Re: zoom screen id on envi_display_bands

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:56:32 PDT 2025

Total time taken to generate the page: 0.32433 seconds