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

Home » Public Forums » archive » Matrix indexing question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Matrix indexing question [message #38956] Fri, 02 April 2004 07:30
Matt Feinstein is currently offline  Matt Feinstein
Messages: 33
Registered: July 2002
Member
If I set

x = [[1,2,3,4,5,6],[7,8,9,10,11,12]]

then (case A)

print, x[[3,4],[1,0]]

gives

10 5

which is slick, and is the kind of indexing I want. However, if (Case
B) I set

y = [[3,4],[1,0]]

then

print, x[y]

gives

4 5
2 1

which, I guess, is also slick-- but is not what I want. Is there any
way to set a variable 'y' that will give me the kind of indexing in
Case A?

And, yes, I know that I can set

y = [9, 4]

and get the 'right' answer. Is this the only way?

Matt Feinstein

--
There is no virtue in believing something that can be proved to be true.
[Message index]
 
Read Message
Previous Topic: 8 bit color
Next Topic: selfcreating filenames for putput files?

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

Current Time: Fri Oct 10 13:04:51 PDT 2025

Total time taken to generate the page: 0.64094 seconds