operators: Binary operations on matrices/vectors

Description Usage Arguments Value Examples

Description

This operator allows to do elementwise operation of two algebraic object i.e. matrices/vectors. There is one required condition to perform such operation: at least one domension values from both objects must be the same

Usage

1
2
3
4
5
6
7
a %m% b

a %d% b

a %-% b

a %+% b

Arguments

a

matrix/vector

b

matrix/vector

Value

Matrix/vector

Examples

1
2
3
4
5
6
7
8
# Multiply
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %m% v(5,4,3)
# Divide
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %d% v(5,4,3)
# Add
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %+% v(5,4,3)
# Subtract
m(1, 2, 3 | 4, 5, 6 | 7, 8, 9) %-% v(5,4,3)

matricks documentation built on March 26, 2020, 6:22 p.m.