Increments and Decrements [message #93784] |
Fri, 14 October 2016 15:31  |
smnadoum
Messages: 24 Registered: June 2016
|
Junior Member |
|
|
Can anyone help with the following?
C is a [4,5,3]
1)Starting from the first element in array 'c', I need to output every 5th element and then output in 'e'.
2)Starting from the last element in 'c', I need to count backwards using decrements and output every 5th element in 'c' and then output in 'f'.
How do I do this in IDL? Thanks
|
|
|
Re: Increments and Decrements [message #93785 is a reply to message #93784] |
Sat, 15 October 2016 00:29  |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le samedi 15 octobre 2016 00:31:07 UTC+2, Cheryl a écrit :
> Can anyone help with the following?
>
> C is a [4,5,3]
>
> 1)Starting from the first element in array 'c', I need to output every 5th element and then output in 'e'.
>
> 2)Starting from the last element in 'c', I need to count backwards using decrements and output every 5th element in 'c' and then output in 'f'.
>
> How do I do this in IDL? Thanks
e = (reform(c,c.length))[0:*:5]
f = (reform(c,c.length))[-1:0:-5]
alx.
|
|
|