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

Home » Public Forums » archive » Array index for arrays
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
Array index for arrays [message #28337] Tue, 04 December 2001 05:18 Go to next message
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
z=indgen(4,4)
ix=[0,1]
help,z[ix,ix]

<Expression> INT = Array[2]



Not what I expected !?!
Re: Array index for arrays [message #28409 is a reply to message #28337] Wed, 05 December 2001 08:16 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
air_jlin@yahoo.com (Johnny Lin) writes:


> Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message
> news:<onr8qb6ok2.fsf@cow.physics.wisc.edu>...
>> [...]
>>
>> Yes, this has burned me a couple of times. The short answer is that
>> when you combine two or more "index lists", then they are treated as
>> one-for-one coordinate lists. What you want can be achieved in two
>> separate indexing steps:
>>
> but how come adding a third "*" dimension gives something you would
> expect?

The special behavior only shows up when all of the dimensions are
indexed by arrays. If even one dimension is indexed by a scalar
number or A:B index range, then you will get the "standard" behavior.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: strange problem: Alarm Clock????....
Next Topic: I have committed a sin CONGRID

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

Current Time: Wed Oct 08 13:44:47 PDT 2025

Total time taken to generate the page: 0.00510 seconds