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

Home » Public Forums » archive » Function with something like [2:*] as input
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: Function with something like [2:*] as input [message #87143 is a reply to message #87138] Fri, 10 January 2014 04:34 Go to previous messageGo to previous message
andry is currently offline  andry
Messages: 7
Registered: March 2013
Junior Member
On Thursday, January 9, 2014 5:27:31 PM UTC-3:30, Matthew Argall wrote:
> Here is one way to do it. Create the function below, then
>
>
>
> IDL> array = findgen(20)
>
> IDL> print, SubArray(array, 1, 3)
>
> IDL> print, SubArray(array, 1, N_Elements(array)-1)
>
> IDL> print, SubArray(array, 1, -1)
>
>
>
>
>
> function SubArray, array, index1, index2
>
> return, array[index1:index2]
>
> end

Thanks,

I did not know about the "-1" index.

Andry
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Download files from the web
Next Topic: NITER in MPFITFUN

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

Current Time: Wed Oct 08 15:59:55 PDT 2025

Total time taken to generate the page: 0.00190 seconds