Skip to main content
1-Visitor
February 11, 2010
Question

Matix calcs with a different number of columns

  • February 11, 2010
  • 4 replies
  • 2615 views
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

23-Emerald V
February 11, 2010
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
SamW1-VisitorAuthor
1-Visitor
February 11, 2010
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
February 11, 2010
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