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

Home » Public Forums » archive » Summer "English" heat or just me: Array slicing
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: Summer "English" heat or just me: Array slicing [message #85301 is a reply to message #85299] Tue, 23 July 2013 09:16 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Tuesday, July 23, 2013 5:51:10 PM UTC+2, ameigs wrote:
> I'm betting this is too easy, but having been away from my work computer for several weeks I think dementia has set in:
>
>
>
> Here's a simple array:
>
> IDL> a = [[1,2,3,4,5,6],[7,8,9,10,11,12]]
>
> IDL> help, a
>
> A INT = Array[6, 2]
>
> IDL> print, a
>
> 1 2 3 4 5 6
>
> 7 8 9 10 11 12
>
>
>
> I want to get just the indices of dim 0 and dim 1 I need from a list of indices. So I tried this:
>
> IDL> print, a[[0,3,5],[0]]
>
> % All array subscripts must be same size. Var = A
>
>
>
> But this works
>
> IDL> print, a[[0,3,5],0]
>
> 1 4 6
>
> IDL> print, a[[0,3,5],1]
>
> 7 10 12
>
> IDL>
>
> IDL> print, a[[0,3,5],0:1]
>
> 1 4 6
>
> 7 10 12
>
> IDL>
>
> And this does not:
>
> IDL> print, a[[0,3,5],[0,1]]
>
> % All array subscripts must be same size. Var = A
>
> % Execution halted at: $MAIN$
>
>
>
> What have I forgotten?
>
>
>
> Andy

If all subscripts are array subscripts, then their sizes must be equal.

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thickness of /box_axes?
Next Topic: Dashed linestyle in vectorized function graphics output, IDL 8.2.3

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

Current Time: Wed Oct 08 18:25:48 PDT 2025

Total time taken to generate the page: 0.00403 seconds