Vectorize
Many operators and functions have a different meaning when applied to arrays. For instance, when you want to multiply each element in a vector by the corresponding element in another vector, you cannot simply multiply them because Mathcad will assume you are taking the dot product, and a scalar value will be returned.
Mathcad includes a vectorize operator which allows you to apply an operation with its scalar meaning on an element by element basis. The vectorize operator is available on the matrix toolbar or by typing control-minus.
Consider the following vectors:
Compare the following expressions. When vectorize is applied, a vector is returned rather than a scalar.
In the first expression, x*y returns a scalar, as does the magnitude of z.
or
or
These two scalars are multiplied together to obtain the final result.
or
However, when vectorize is applied, each element in x will be multiplied by the corresponding element in y and by the absolute value of the corresponding element in z:
or
Mathcad will implicitly vectorize trigonometric, logarithmic, Bessel and probability distribution functions when a vector is passed as an argument.
It will also implicitly vectorize vector arguments when the factorial, square and nth root, exponentiation and any relational operators are applied.
However, the vectorize operator must still be applied for all of these functions and operators in the case of a matrix argument.