help-octave
[Top][All Lists]
Advanced

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

Re: Applying each element of a vector to each row of a matrix


From: Jordi Gutiérrez Hermoso
Subject: Re: Applying each element of a vector to each row of a matrix
Date: Sun, 19 Dec 2010 11:08:45 -0600

2010/12/19 Martin Helm <address@hidden>:
> Am Sonntag, 19. Dezember 2010, 17:11:42 schrieb Jordi Gutiérrez Hermoso:
>> 2010/12/19 Martin Helm <address@hidden>:
>> > Am Sonntag, 19. Dezember 2010, 16:33:20 schrieb Jordi Gutiérrez
>> >
>> > Hermoso:
>> >> I'm often found with a situation in which I have some matrix A and
>> >> some vector v and I would like to do something like multiply each
>> >> column or row in A by each element of v.
>> >
>> > There is a special type "diagonal matrix" which should fit your
>> > needs.
>>
>> [snip]
>>
>> > diag(v)*a for example
>>
>> Ah, yes, I hadn't thought of that. Jaroslav worked on extending diag
>> matrices. But that only covers the multiplication and division cases.
>>
>> Sometimes I also want to do this with exponentiation. What then?
>
> But exponentiation of a diagonal matrix is trivial:

No, no... exponentiate each row or column of a matrix by each element
of a vector.



reply via email to

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