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 #39460 is a reply to message #39326] Mon, 17 May 2004 09:04 Go to previous messageGo to previous message
tam is currently offline  tam
Messages: 48
Registered: February 2000
Member
Tmorri wrote:

> Thanks for your replay. I made a little mistake in the statement of the
> problem, what I really need is this:
>
> x1,x2,x3,x4,x5 are variables that can take any value, even zero, (0).
>
> I just want to get rid othe zeroes shown in vector v0
>
> v0=[0 x1 x2 x3 0 x4 x5 x1 0 x2 x3 x4 0 x5 x1 x2 0 x3 x4 x5]
>
> in the following way:
>
> v1=[0 0 0 0 0]
>
> v2=[x1 x2 x3 x4 x5 x1 x2 x3 x4 x5 x1 x2 x3 x4 x5]
>
> Thanks for your help.
>
> Tmorri
>
>
Then something like:

v2 = v0[ (lindgen(n_elements(v0)) mod 4) ne 0]

might do the trick. In practice I'd usually split
it out into a couple of lines.

index = lindgen(n_elements(v0))
v2 = v0[ (index mod 4) ne 0]


Regards,
Tom McGlynn
[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 Oct 10 17:12:33 PDT 2025

Total time taken to generate the page: 1.20037 seconds