Using the C++ Math Library    

How to Call Operators

Many of the operators in MATLAB have operator equivalents in C++. The syntax for these C++ operators is identical to that of their MATLAB counterparts, and you call them directly as operators.

In addition, every operator in MATLAB is mapped directly to a function in the MATLAB C++ Math Library. For MATLAB operators that do not have operator equivalents in C++, determine the name of the function that corresponds to the operator and then call the function as explained above.

The section Operators in Chapter 11 lists the MATLAB operators and the corresponding MATLAB C++ Math Library functions.


 Example Program: Calling Library Functions (ex2.cpp) Example Program: Passing Functions As Arguments (ex3.cpp)