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: Row-specific scalar multiplication
Replies: 5   Last Post: Mar 15, 2011 12:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Abed Alnaif

Posts: 13
Registered: 10/21/08
Row-specific scalar multiplication
Posted: Mar 12, 2011 4:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I'm trying to do row-specific matrix multiplication. I know that this is confusing; it is best described by an example:

For example, say that I have:

f = [2; 4];

A = [1 2 3; 1 2 3];

I'm trying to find an operation such that

f .* A

returns

[2 4 6; 4 8 12]

In this example, I used the ".*" operation. However, this returns a Matlab error since the matrix dimensions do not agree. Does anyone know of a way to accomplish what I am trying to do, without resorting to loops?

Thanks,

Abed Alnaif



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.