[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiply diagonal matrix and full matrix
From: |
Jaroslav Hajek |
Subject: |
Re: Multiply diagonal matrix and full matrix |
Date: |
Fri, 20 Feb 2009 12:36:15 +0100 |
On Fri, Feb 20, 2009 at 12:23 PM, José Luis García Pallero
<address@hidden> wrote:
> Exist any trick in GNU Octave for multiply two matrices, one diagonal and
> other full, without the use of command diag() nor for loop?
>
Octave 3.0 has "dmult" which essentially does something like repmat
(A(:), 1, columns (B)) .* B.
In Octave 3.2, there will be no need for such tricks, because diag(A)
* B will be the most efficient as well as the most readable syntax
(even more efficient than the above), so dmult is deprecated (by a
funny coincidence I deprecated it a couple of minutes ago).
3.2 will be out soon so unless you expect to be stuck with an older
series, I suggest you just use diag () *,
and you'll soon get your code boosted ;)
cheers
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz