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

Home » Public Forums » archive » Re: Help with matrix operations
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 with matrix operations [message #954 is a reply to message #952] Tue, 27 April 1993 01:33 Go to previous message
dan is currently offline  dan
Messages: 27
Registered: March 1993
Junior Member
In article <1rk7gs$4m6@morrow.stanford.edu>, pln@egret0.Stanford.EDU (Patrick L. Nolan) writes:
|> I have a little matrix problem that I'm trying to do without using
|> loops. So far I'm not clever enough to figure out how to do it.
|> Suppose we have
|> A = fltarr(N,N)
|> B = fltarr(N)
|> C = fltarr(N,N,N)
|> I want to have C(i,j,k) = A(i,j) + B(k)
|> for all i,j,k < N. Is there a way to do this without writing
|> ugly loops? I'm sure it's trivial, and I'll feel like a dope
|> when the first person points it out. Fire away.
|>
|> --
|> * Patrick L. Nolan (415)723-0133 *
|> * W. W. Hansen Experimental Physics Laboratory (HEPL) *
|> * Stanford University *
|> * Bitnet: PLN@SLACVM Internet: pln@egret0.stanford.edu *

How about

for k=1,n do c(*,*,k) = a(*,*) + b(k)

That has a loop but its not to ugly.


**************************************************
** Dan Bergmann dbergmann@llnl.gov **
**************************************************
--
**************************************************
** Dan Bergmann dbergmann@llnl.gov **
**************************************************
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: plotting vs year-month-day
Next Topic: Re: help for install IDL on Solris 2.1

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

Current Time: Fri Oct 10 03:58:42 PDT 2025

Total time taken to generate the page: 1.11941 seconds