Math Operations Library The blocks in this library relate to common mathematical functions.
Add, Subtract and Sum Blocks The Add, Subtract and Sum blocks are all essentially the same. By
changing the Icon shape and List of signs in the block parameter you
can convert one into the other (see right).
Product and Divide Blocks The Product and Divide blocks are also interchangeable. You can use a list of asterisks
and forward slashes in the number of inputs block parameter to define operations
needed e.g. Block to the right was created by number of inputs = /*/** Gain Block The Gain block can be used to multiply a signal by a constant
value. You must configure the Block Parameters to perform
matrix or element-wise (array) multiplication.
Array and Matrix Multiplication: Array multiplication with column vector 𝐾 = [1
2
]
and Matrix multiplication where 𝐾 = [5 6
7 8
]
Both examples have Gain block configured to do Matrix(u*K) multiplication. For a Gain block to
contain a matrix or vector, simply use MATLAB notation. For example
[5 6
7 8
]
is entered as
[5, 6; 7, 8] – commas separate row elements and semi colons separate columns. Mathematical Functions There are lots of blocks for specific mathematical functions:
The Abs block finds the magnitude or absolute value of a
signal, the Unary Minus block negates a signal and the
Bias block adds a constant to a signal. The Sign block
outputs +/- 1 depending on the sign of the input.
There are also blocks with multiple functions to choose from:
The Math Function block can perform many different functions: square,
square root, log, reciprocal etc. A block parameter allows you to select which