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

Home » Public Forums » archive » Re: Help me aviod a FOR loop!?!?
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: Help me aviod a FOR loop!?!? [message #30411] Thu, 25 April 2002 07:47 Go to previous message
James Tappin is currently offline  James Tappin
Messages: 54
Registered: December 1995
Member
Sean Davis wrote:

> I don't know if this is possible. I have 4 coeffecients,
> a,c,d,cd, that are each 3191-long arrays, and I would like to construct
> 3191, waveforms (of length 128) from these coefeccients.
>
> Here's what I'm trying to do:
>
> x = FINDGEN(128)
> yfit = FLTARR(128,3191)
>
> yfit = (a/cd)*( exp(-1.*c*x)-exp(-1.*d*x) )
>
> In the end, I would like yfit to be an array of (128,3191) or (3191,128).
>
> I can't figure out how to do this without using a FOR loop. Is there any
> hope for doing this without a FOR loop?
>

Try this:
x=findgen(1,128)
d1=intarr[128]
d2=intarr[3191]
yfit= (a/c*d)[*,d1]*(exp(-c[*,d1]*x[d2,*])-exp(-d[*,d1]*x[d2,*])

You could use explicit intarr calls for the dummy indices, but it take more
space.

James

--
+------------------------+-------------------------------+-- -------+
| James Tappin | School of Physics & Astronomy | O__ |
| sjt@star.sr.bham.ac.uk | University of Birmingham | -- \/` |
| Ph: 0121-414-6462. Fax: 0121-414-3722 | |
+--------------------------------------------------------+-- -------+
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: signed character
Next Topic: Re: How to make a ribbon plot

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

Current Time: Wed Oct 08 19:20:05 PDT 2025

Total time taken to generate the page: 0.00477 seconds