Skip to main content
20-Turquoise
November 12, 2016
Solved

Vectorize _ Is there a reason Mathcad doesn't accept it ?

  • November 12, 2016
  • 3 replies
  • 2501 views

  Hello Everyone,

(1).PNG

  The question is : Is there a reason Mathcad 14 doesn't accept (3) ?

       Thanks in advance for your time and help.

             Regards.

Best answer by RichardJ

The problem is that you want to do a matrix operation followed by a vectorized operation. i.e you want to multiply a 3x3 matrix by a 3x1 vector to get a 3x1 vector, and then you want to multiply that 3x1 vector by another 3x1 vector, element by element. You can't make that work by vectorizing it, because then (as Stuart notes) the first operation fails. You also can't make it work by not vectorizing it, because then you get a scalar answer, and the comparison fails. So the only way to do it is a two step process.

3 replies

23-Emerald V
November 12, 2016

Loi Le wrote:

  Hello Everyone,

  The question is : Is there a reason Mathcad 14 doesn't accept (3) ?

       Thanks in advance for your time and help.

             Regards.

Yes.  Vectorization can only take place when the arrays have the same number of rows and columns.  You've got a 3x3 trying to vectorize multiplication with two 3x1 arrays, so Mathcad won't permit it.

Vectorizing two 3x3s is just fine.

Stuart

RichardJ19-TanzaniteAnswer
19-Tanzanite
November 12, 2016

The problem is that you want to do a matrix operation followed by a vectorized operation. i.e you want to multiply a 3x3 matrix by a 3x1 vector to get a 3x1 vector, and then you want to multiply that 3x1 vector by another 3x1 vector, element by element. You can't make that work by vectorizing it, because then (as Stuart notes) the first operation fails. You also can't make it work by not vectorizing it, because then you get a scalar answer, and the comparison fails. So the only way to do it is a two step process.

lvl10720-TurquoiseAuthor
20-Turquoise
November 12, 2016

   Thanks for your time and help, Stuart and Richard. With your explanation I have got what I want . (3).PNGMany thanks for this.

(2).PNG

   Best Regards.