cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

## Matix calcs with a different number of columns  1-Newbie

## Matix calcs with a different number of columns

I thought there might be away of multiplying each element in a row of one matrix by the corresponding row in a single column matrix. I understand why this doesn't work in mathematical terms, but I was hoping that there was a way of getting Mathcad to do this. I've used the vectorise (sorry, vectorize) function, but it expects the maticies to have the same number of rows and columns.

I've attached the worksheet as an example.
4 REPLIES 4  23-Emerald II
(To:SamW)
On 2/11/2010 12:29:28 PM, SamW wrote:
== I thought there might be away of multiplying each element in a row of one matrix by the corresponding row in a single column matrix. I understand why this doesn't work in mathematical terms, but I was hoping that there was a way of getting Mathcad to do this.

Writing a specific function is probably the best way, but here's one way using just a range variable, the column operators and the vectorize operator.

Stuart  1-Newbie
(To:StuartBruff)
Thanks Stuart,

That helps, is there a way to do a similar thing so each row in a single column matrix is multiplied by each column in a single row matrix.  19-Tanzanite
(To:SamW)
A single column matrix is a vector. If you transpose the single row matrix that is also a column vector. Then you can multiply them element by element if you vectorize the multiplication.

Richard  23-Emerald II
(To:StuartBruff)
On 2/11/2010 12:56:23 PM, stuartafbruff wrote:
On 2/11/2010 12:29:28 PM, SamW wrote:
== I thought there might be away of multiplying each element in a row of one matrix by the corresponding row in a single column matrix. I understand why this doesn't work in mathematical terms, but I was hoping that there was a way of getting Mathcad to do this.
== Writing a specific function is probably the best way, but here's one way using just a range variable, the column operators and the vectorize operator.

About 20 seconds after I posted the message, as I was walking out to the car, I thought of another couple of ways, one using the diag function.

Stuart 