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

Home » Public Forums » archive » Re: Approximate convolution - for loop problem
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: Approximate convolution - for loop problem [message #64414 is a reply to message #64402] Sun, 21 December 2008 12:44 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sam writes:

> Hi David, unfortunately shift() does not do the business for me, as
> these two examples below show. So I'm still a bit stumped here.
>
> ; Array operation I'm trying to execute.
> a=3D[1.,2.,3.,4.]
> for ii=3D1,3 do a[ii] +=3D 0.5*a[ii-1]
> print,a
> 1.00000 2.50000 4.25000 6.12500
>
> ; Attempt to perform this operation with shift()
> a=3D[1.,2.,3.,4.]
> a +=3D 0.5*shift(a,-1)
> print,a
> 2.00000 3.50000 5.00000 4.50000

Humm. Yes, I see what you mean. I think you might
be out of luck without a loop here, since the *next*
calculation depends on the *previous*. I don't see how
it can be done without a loop.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Sun symbol (again!)
Next Topic: Re: Problem reading data from stdin using EOF(0) in version 6.0 and 7.0

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

Current Time: Wed Oct 08 17:53:10 PDT 2025

Total time taken to generate the page: 0.00438 seconds