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

Home » Public Forums » archive » Re: Speedy way to get compare array elements. . .
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: Speedy way to get compare array elements. . . [message #33099 is a reply to message #33031] Tue, 03 December 2002 22:54 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
trouble wrote:
> Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message news:<on4raklqpk.fsf@cow.physics.wisc.edu>...
>
>> ...The cool thing about the trick is that IDL *automatically* truncates
>> the vector A so that it matches the length of A[1:*].
>>
>
>
> Ah, but is there any way to not make it do that? Say you have 2
> vectors of different lengths:
>
> x = findgen(50)
> y = findgen(100)
>
> and you want to form z = x * y, but have z the same length as y
> putting zeros where x has no value. The (sorry) way I am doing it is
>
> z = y * 0
> z[0:49] = x * y
>
> which clearly is too much programmer work since I have to get the
> lengths... Any ideas?
>
> Ciao.

I got the impression my news-server is a little slow,
but anyway (as I see no reply so far):

just say:

z[0]=x*y

IDL the copies as many values as there are to z[0] and the
following elements.

marc
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: georeferencing satellite data
Next Topic: Running FlexLM on OS X

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

Current Time: Wed Oct 08 18:41:49 PDT 2025

Total time taken to generate the page: 0.00416 seconds