Using the C++ Math Library    

Operators

The majority of operators in the MATLAB C++ Math Library fall into two groups: the arithmetic operators that perform arithmetic on their operands and the relational operators that perform logical operations on their operands. Both types of operators return an array of results.

Arithmetic operators operate either in an element-wise fashion, like + (addition), or in an operator-dependent manner, like * (matrix multiplication). Relational operators, on the other hand, always perform an element-by-element comparison of their operands. Each element in the returned array is the result of applying the operation to the corresponding elements of the operand array. For example, if  A, B, and C are matrices, and C = A < B, then C[i] = (A[i] < B[i]).

All operators, including a third group of miscellaneous operators, expect mwArray objects as operands. If you use scalars, you call the standard C++ operators. 4 + 5, for example, does not use the matrix addition operator.


 Library Routines Arithmetic Operators