Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.
|
|
|
Row-specific scalar multiplication
Posted:
Mar 12, 2011 4:12 PM
|
|
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
|
|
|
|