Programmer Guide/Command Reference/EVAL/mul: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE: | {{DISPLAYTITLE:mul (alias: "x*y")}} | ||
Compute the product of the arguments. | |||
;Usage: <code>mul(''x'', ''y'')</code> | |||
;Result: If both arguments ''x'' and ''y'' are vectors, the tensor (or dyadic) product of the vectors is computed and the result ''r'' is a matrix with <code>nrow(''x'')</code> rows and <code>nrow(''y'')</code> columns. | |||
::<code>''r''<sub>i,j</sub> = ''x''<sub>i</sub> * ''y''<sub>j</sub></code> | |||
:For all other combinations of data types, the [[../#Operators|operator *]] is applied to ''x'' and ''y'' and the product <code>''x''*''y''</code> is returned. If the multiplication is not possible (invalid combination of data types), the function fails. | |||
;See also: [[../trn|trn]], [[../inv|inv]], [[../complex arithmetic#special functions|ctrn, cmulv]] | |||
[[../#Functions|<function list>]] | |||
Latest revision as of 11:24, 21 April 2011
Compute the product of the arguments.
- Usage
mul(x, y)
- Result
- If both arguments x and y are vectors, the tensor (or dyadic) product of the vectors is computed and the result r is a matrix with
nrow(x)
rows andnrow(y)
columns.ri,j = xi * yj
- For all other combinations of data types, the operator * is applied to x and y and the product
x*y
is returned. If the multiplication is not possible (invalid combination of data types), the function fails.
- See also
- trn, inv, ctrn, cmulv