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

Home » Public Forums » archive » Re: Multiplying a cube by a vector
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: Multiplying a cube by a vector [message #18226] Thu, 09 December 1999 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Pierre Chanial <pchanial@cea.fr> writes:

> Hi !

> Has anybody written a function that multipies an array by a vector along
> a given dimension?
> For the last dimension, one can do for an array of dimension nx,ny,nz :

> vector_unit = replicate(1, nx*ny)
> newcube = vector ## vector_unit
> newcube = reform(cube,nx*ny, nz) * temporary(newcube)
> newcube = reform(newcube, nx,ny,nz, /overwrite)

> but for the other dimensions ?

> Cheers Pierre

Pierre:

I believe that the following will what you want. If CUBE has the dimensions
(NX,NY,NZ), and VECTOR_Y has the dimensions (NY), then you can multiply the two
with the command

NEWCUBE = REBIN( REFORM(VECTOR_Y, 1,NY,1), NX,NY,NZ)

(I believe that Stein Vidar Haugan first pointed this out.)

William Thompson
[Message index]
 
Read Message
Previous Topic: Printing on Win platforms
Next Topic: How to select best from a long list?

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

Current Time: Fri Oct 10 12:53:03 PDT 2025

Total time taken to generate the page: 0.95849 seconds