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

Home » Public Forums » archive » generating sequences
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: generating sequences [message #85843 is a reply to message #85842] Fri, 13 September 2013 12:29 Go to previous messageGo to previous message
spluque is currently offline  spluque
Messages: 33
Registered: September 2013
Member
On Friday, September 13, 2013 2:10:40 PM UTC-5, Mats Löfdahl wrote:
> On 2013-09-13 21:01, spluque@gmail.com wrote:
>
>> Hi,
>
>>
>
>> I thought this should be very easy, but I cannot find how to do it IDL. Say we have a vector with a few starting values:
>
>>
>
>> a=[1, 12, 90]
>
>>
>
>> and we want to generate sequences of 3 numbers starting with these values, so that we end up with:
>
>>
>
>> [1, 2, 3, 12, 13, 14, 90, 91, 92]
>
>>
>
>> How is this done in IDL?
>
>
>
> IDL> print,reform(transpose([[a],[a+1],[a+2]]),9)
>
> 1 2 3 12 13 14 90 91 92

What if the sequence for each starting value was 1000 instead of 3?...

I'm surprised one can't just do:

print, a + indgen(3)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: strsplit vectorized
Next Topic: Re: Filled area curve

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

Current Time: Wed Oct 08 18:59:16 PDT 2025

Total time taken to generate the page: 0.00471 seconds