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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Replicate from [1, 148] to [1000, 148] [message #30344] Thu, 18 April 2002 18:46
Wang, Chi-Kuei is currently offline  Wang, Chi-Kuei
Messages: 6
Registered: April 2002
Junior Member
Thank you all.

Chi-Kuei


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?
>
> Thanks,
>
> Chi-Kuei
>
>
Re: Replicate from [1, 148] to [1000, 148] [message #30346 is a reply to message #30344] Thu, 18 April 2002 16:17 Go to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
chi-kuei <cw94@cornell.edu> wrote:
> 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?

Yes! See the ever-so useful following site:
http://www.dfanning.com/tips/rebin_magic.html

Good luck,

- Marshall
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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Fri Oct 10 03:09:59 PDT 2025

Total time taken to generate the page: 1.51999 seconds