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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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

lvl107
20-Turquoise

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

  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.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:lvl107)

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.

View solution in original post

3 REPLIES 3
StuartBruff
23-Emerald II
(To:lvl107)

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

RichardJ
19-Tanzanite
(To:lvl107)

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.

lvl107
20-Turquoise
(To:RichardJ)

   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.

Top Tags