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

Home » Public Forums » archive » Re: Using two different arrays in tha same calculation
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: Using two different arrays in tha same calculation [message #2243 is a reply to message #2232] Wed, 08 June 1994 07:42 Go to previous messageGo to previous message
dan is currently offline  dan
Messages: 27
Registered: March 1993
Junior Member
Newsgroup: comp.lang.idl-pvwave:
Subject: Using two different arrays in tha same calculation

ragnar@kvark.fi.uib.no (Ragnar Aas) writes :

> I have the following problem :
>
> I have two different arrays, (8) of float and (300,8) of float.
> I want to vectorize the equation and therefore I need to use both
> arrays in the same equation. For example :
>
> newarray=cos(small_array)*sin(large_array)
>
> where I want the data in small_array to be used over and over 300 times
> in this calculation.
>
> Hope somebody can help me.
>

Ragnar,

You can use the # operator (matrix multiply) to make the small (8)
array into a (300,8) array. Try this :

IDL> arr1 = Findgen(8)
IDL> arr2 = Findgen(300, 8)
IDL> newarr = (Replicate(1.0, 300) # Cos(arr1)) * Sin(arr2)

------------------------------------------------------------ -------------------
Dan Carr
Research Systems
Boulder, Colorado
dan@rsinc.com
------------------------------------------------------------ -------------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Does PVWAVE V4.2 work with Motif V1.2 under VMS?
Next Topic: Re: Problems with Idl and Irix 5.2-alpha

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

Current Time: Fri Oct 10 12:47:29 PDT 2025

Total time taken to generate the page: 0.00676 seconds