|
Contents | Previous | Next | Subchapters |
| Syntax |
left value * right value
|
| See Also | division addition subtraction , and element-by-element multiplication , |
6 * 2
O-Matrix will respond
12
x = {[1, 2, 3], [4, 5, 6]}
y = {[2, 4], [2, 4], [2, 4]}
x * y
O-Matrix will print
{
[ 12 , 24 ]
[ 30 , 60 ]
}
x = {[1, 2, 3], [4, 5, 6]}
x * 2
will result in
{
[ 2 , 4 , 6 ]
[ 8 , 10 , 12 ]
}
If one value is a scalar,
the result has the same dimension as the other value.
If neither value is a scalar,
the column dimension of the left value must match the row dimension of
the right value.
In this case, the result has the same number of rows as the left
value and the same number of columns as the right value.
If the column dimension of the left value is zero,
the resulting matrix has all of its elements equal to zero.
If you enter
x = fill(1, 2, 0)
y = fill(1, 0, 3)
x * y
O-Matrix will respond
{
[ 0 , 0 , 0 ]
[ 0 , 0 , 0 ]
[ 0 , 0 , 0 ]
}