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

Home » Public Forums » archive » Re: Replicate from [1, 148] to [1000, 148]
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: Replicate from [1, 148] to [1000, 148] [message #30347 is a reply to message #30346] Thu, 18 April 2002 13:46 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"chi-kuei" <cw94@cornell.edu> wrote in message
news:a9nar8$pg7$1@news01.cit.cornell.edu...
> Hi all,
>
> I have a [1000,148] matrix. Each column is a data stream and needs to be
> subtracted by a [1,148] matrix. Since I can't find a way to do it in one
IDL
> line, i.e.,
>
> [1000,148]-[1,148]
>
> I have to do it this way:
>
> [1000,148] - replicate([1,148], 1000)
>
> However, the replicate won't do the job. Right now I am doing this by a
> loop. This really slows the procedure down. Is there any better way to do
> it?

Using your informal notation, this is a good way to do it:

[1000,148] - Rebin([1,148], 1000, 148)

This effectively copies each item across the 1000 columns, giving the shape
that you want. Replicate really won't work here.

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Replicate from [1, 148] to [1000, 148]
Next Topic: Re: Draw a point in 3D graphic object ?

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

Current Time: Wed Dec 03 11:01:50 PST 2025

Total time taken to generate the page: 2.07570 seconds