Programmer Guide/Command Reference/EVAL/mul: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:mul (alias: "x*y")}}
{{DISPLAYTITLE:mul (alias: "x*y")}}
Compute the inverse of ''x''.  
Compute the product of the arguments.  
;Usage:  
;Usage: <code>mul(''x'', ''y'')</code>
:{|class="keinrahmen"
;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>inv(''x<sub>scalar</sub>)</code>'''
::<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.
|'''<code>inv(''x<sub>matrix</sub>)</code>'''
|-
|}
;Result: The result has the same type as the argument ''x'' and is the inverse of ''x''. The argument ''x'' must be a scalar or a square matrix.
;Note: This function can be used as alias for the [[Programmer_Guide/Command_Reference/EVAL#Operators|operator *]], which do not implement the dyadic product. both arguments ''x'' and ''y'' are vectors, the dyadic product is computed, otherwise the [[Programmer_Guide/Command_Reference/EVAL#Operators|operator *]] is applied to ''x'' and ''y''.


;See also: [[Programmer_Guide/Command_Reference/EVAL/trn|trn]], [[Programmer_Guide/Command_Reference/EVAL/mul|mul]], [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic#special functions|ctrn, cmulv]],
;See also: [[../trn|trn]], [[../inv|inv]], [[../complex arithmetic#special functions|ctrn, cmulv]]  


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[../#Functions|<function list>]]
 
 
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====mul=====
 
Calculate the dyadic product of <var>x</var>v and <var>y</var>v.
 
=====Usage:=====
 
<code>mul(<var>x</var>v,<var>y</var>v)</code>
 
=====Return Type:=====
 
matrix - (nrow(<var>x</var>v) x nrow(<var>y</var>v))
 
=====Notes:=====
 
Note that if one of the arguments is not a vector, then <var>x</var> * <var>y</var> is calculated.

Latest revision as of 12: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 and nrow(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

<function list>

Navigation menu

Personal tools