Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Help vectorize this matrix multiplication
Replies: 3   Last Post: Jun 25, 2011 3:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jim Rockford

Posts: 163
Registered: 6/30/06
Help vectorize this matrix multiplication
Posted: Jun 24, 2011 11:59 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a matrix M for which I want to multiply each row by a scalar,
which can be different for each row.

One way to do it is as follows. Suppose the set of scalars are put
into a vector v. Then

diag(v) * M

effects this multiplication.

In my case, the problem is that constructing the diagonal matrix
diag(v) will exceed my computer memory. Obviously I could resort to a
loop, but I'm wondering if there is a different way to vectorize this
multiplication.

Thanks,
Jim



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.