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

Home » Public Forums » archive » subscripting arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
subscripting arrays [message #46258] Sun, 13 November 2005 20:47 Go to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Hi all,

this is probably simple, but I can't figure it out right now:

I want to extract an element from a 2d array, and I have the 2d
subscripts of that element available as a 2-element vector.

IDL> a = dist(300)
IDL> b = [30, 50]
IDL> print, a[b]
30.0000 50.0000

Not what I want. What I want is

IDL> print, a[b[0], b[1]]
58.3095

Is there a more elegant way than splitting b up?

Thanks,
Benjamin
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Best platform for IDL 6.2?
Next Topic: Re: SMOOTH function for 3D

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

Current Time: Wed Oct 08 13:42:59 PDT 2025

Total time taken to generate the page: 0.00409 seconds