Error, (in rtable/Product) use *~ for elementwise multiplication of Vectors or Matrices; use . (dot) for Vector/Matrix multiplication
Description
Examples
See Also
An expression involving the multiplication of Vectors and/or Matrices (possibly and/or Arrays) has been constructed using the standard multiplication operator, `⋅`, which is ambiguous.
This will happen if Vectors and/or Matrices are multiplied using a commutative multiplication operator, `⋅`:
A ≔ a__11a__12a__21a__22
A:=a__11a__12a__21a__22
v ≔ v__1v__2
v:=v__1v__2
A⋅v
W ≔ Array1..2,1..2,a,b,c,d;
W:=abcd
A W
Solution:
To multiply Vectors and/or Matrices together using the standard Linear Algebra multiplication operation, use the non-commutative multiplication operator, `.` (dot):
A . A
a__112+a__12⁢a__21a__11⁢a__12+a__12⁢a__22a__11⁢a__21+a__21⁢a__22a__12⁢a__21+a__222
A . v
a__11,a__11⁢v__1,v__1+a__12,a__12⁢v__2,v__2a__21,a__21⁢v__1,v__1+a__22,a__22⁢v__2,v__2
v . v
v__1,v__1&conjugate0;⁢v__1,v__1+v__2,v__2&conjugate0;⁢v__2,v__2
To multiply Vectors and/or Matrices and/or Arrays together using elementwise multiplication, use the standard multiplication operator, `⋅` followed by the "elementwise" operator, `~`:
A ⋅~ A
a__112a__122a__212a__222
A ⋅~ W
a__11⁢aa__12⁢ba__21⁢ca__22⁢d
Note that when multiplying Arrays together (not with Vectors or Matrices), the standard multiplication operator will result in the elementwise product, so the `~` is not necessary:
W . W
a2b2c2d2
Note also that implicit multiplication is interpreted based on the operands: For Vector/Matrix operands this will be interpreted as the `.` (dot - non-commutative) multiplication operator, while for Array operands this will be interpreted as the elementwise operator:
A v
a__11⁢v__1+a__12⁢v__2a__21⁢v__1+a__22⁢v__2
W W
Array, binary operators, dot, LinearAlgebra, Matrix, Vector
Download Help Document
What kind of issue would you like to report? (Optional)