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

Home » Public Forums » archive » Re: Basic Array Subscripting 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
Re: Basic Array Subscripting Question [message #80302] Thu, 31 May 2012 04:25 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Thu, 31 May 2012 02:38:59 -0700 (PDT), Rob wrote:

> This is very basic stuff but for some reason it's leaving me stumped.
>
> I always thought that:
>
> array[412:413, 18:19] was equivalent to array[[412,413], [18,19]]
>
> but the first returns a 2,2 array (which I want) whilst the second
> only returns a 2 element array.
>
> <Expression> DOUBLE = Array[2, 2]
> <Expression> DOUBLE = Array[2]
>
> Any idea what I'm doing wrong?
>
There is a third way which is very similar to your 2nd expression, but
returns the 2 by 2 array:
b=array[[412,413], [18,19], 0]
or
b=array[[412,413], [18,19], *]

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: put a variable in 2D-array to plot a contour on a map.
Next Topic: Basic Array Subscripting Question

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

Current Time: Sat Oct 11 13:54:32 PDT 2025

Total time taken to generate the page: 1.44431 seconds