The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

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


[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?


Abed Alnaif

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.