help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fastest way to element-by-element multiply matix by vector?


From: Benjamin Lindner
Subject: Re: fastest way to element-by-element multiply matix by vector?
Date: Wed, 20 Jun 2007 07:08:02 +0200

> > Hello all,
> > I need to element-by-element multiply an nXk matrix A by an nX1 vector
> b,
> > so 
> > that the result is that each row of A is multiplied by the corresponding
> > row of 
> > b. This is on the inside loop of some intense calculations, so I'd like
> > the best 
> > performance. Is C = A .* repmat(b,1,k) the best way to do this?
> > Thanks, Michael
> 
> given that size(A)==[n,k] and size(b)==[n,1] I would have done it simply
> as
> 
> C = b*A

... which if course is NONSENSE. 
messed it up with different topic - I really need a coffee first
before beginning to think...

just ignore it

benjamin
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger


reply via email to

[Prev in Thread] Current Thread [Next in Thread]