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

Home » Public Forums » archive » negative indices, am I missing something here?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
negative indices, am I missing something here? [message #81991] Fri, 02 November 2012 12:51
d.rowenhorst@gmail.co is currently offline  d.rowenhorst@gmail.co
Messages: 10
Registered: August 2008
Junior Member
IDL 8 brought negative indices for arrays. Great, love them. However, I am getting strange results.

IDL> a = indgen(3,5)
IDL> print, a[*,-1]
12 13 14

Good, that is what I thought I should get.

IDL> print, a[*, [3,1,4]]
9 10 11
3 4 5
12 13 14

Also, this looks right to me.

So why doesn't this work?
IDL> print, a[*, [3,1,-1]]
9 10 11
3 4 5
0 1 2

Is this the expected behavior? Or a bug?

Mac 10.8.2 IDL 8.2.1
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Reading Analog input from IDL
Next Topic: Big Brother Watching

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

Current Time: Thu Oct 09 07:24:24 PDT 2025

Total time taken to generate the page: 0.72296 seconds