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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Matix calcs with a different number of columns

SamW
1-Visitor

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
StuartBruff
23-Emerald III
(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

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.
RichardJ
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
StuartBruff
23-Emerald III
(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
Announcements

Top Tags