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

Home » Public Forums » archive » Re: Unpacking algoritmn
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: Unpacking algoritmn [message #39328 is a reply to message #39326] Sat, 15 May 2004 09:12 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Tmorri writes:

> Does any one have an IDL algorithm to unpack this vector
>
> v0=[0 1 2 3 0 4 5 1 0 2 3 4 0 5 1 2 0 3 4 5]
>
> in the following way:
>
> v1=[0 0 0 0 0]
>
> v2=[1 2 3 4 5 1 2 3 4 5 1 2 3 4 5]

Do you mean something like this:

IDL> print, v0
0 1 2 3 0 4 5 1 0 2 3 4 0 5 1 2 0 3 4 5
IDL> v1 = v0[where(v0 eq 0)]
IDL> print, v1
0 0 0 0 0
IDL> v2 = v0[where(v0 ne 0)]
IDL> print
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5

Cheers,

David
--

David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Unpacking algorithm
Next Topic: Parsing dates (ARGH!)

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

Current Time: Fri Nov 28 17:00:19 PST 2025

Total time taken to generate the page: 0.01658 seconds