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

Home » Public Forums » archive » Re: array problems
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: array problems [message #61417 is a reply to message #61366] Tue, 15 July 2008 12:24 Go to previous message
David Sheerin is currently offline  David Sheerin
Messages: 4
Registered: April 1999
Junior Member
Great - this is an elegant solution...

Thanks!


"Bob Crawford" <Snowman42@gmail.com> wrote in message
news:8d9523e8-2690-4408-89fb-3f2caed198be@25g2000hsx.googleg roups.com...
On Jul 11, 3:26 pm, "jsch...@gmail.com" <jsch...@gmail.com> wrote:
> On Jul 11, 2:36 pm, "David Sheerin" <davidshee...@btinternet.com>
> wrote:
>
>> Hi All
>> I have a palindromic vector of floats, e.g. [a,b,c,b,a] , and I would
>> like
>> to expand it to include the mean between each value like [(0+a)/2, a,
>> (a+b)/2, b, (b+c)/2, c, (c+b)/2, b, (b+a)/2, a, (a+0)/2]. Is there any
>> elegant way of doing this without having to resort to clunky for loops?
>
>> I also would like to repeat this action on the resulting vector.
>
>> Thanks for any tips
>
>> David
>
> Or, even better, just use interpol.
>
> if
> array = [a, b, c, b, a]
> then
> output = interpol(array, 9)
> is your desired result
>
> Josiah

Don't forget to add in the first and last elements.
output2 = [output[0]/2, output, output[0]/2] - or similar.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Where O Where Di My Pointer Go?
Next Topic: Re: Where O Where Di My Pointer Go?

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

Current Time: Sat Oct 11 10:44:35 PDT 2025

Total time taken to generate the page: 0.48363 seconds