| Using the C++ Math Library | ![]() |
Syntax
The syntax of C++ places several restrictions on the MATLAB C++ Math Library. In general, these restrictions do not mean that functionality is missing from the library, but rather that you access the functionality differently than you would in MATLAB.
C++ restricts the syntax of the library in these ways:
mwArray class, an array creation function, or the vertcat() and horzcat() functions. The : (colon) operator is unavailable in all of its forms. The functional equivalents colon() and ramp() replace it..*, .\, ./, .^ and \ are not valid C++ operators. In the MATLAB C++ Math Library, function calls access the same functionality. The ' (quote) and .' (dot quote) operators are unavailable. The transpose() and ctranspose() functions replace them.{} cell array indexing operator is unavailable. The mwArray::cell() performs indexing into cell arrays.. operator for structure indexing is unavailable. The mwArray::field() performs indexing into structures.Each of these differences is explained in more detail later in this chapter.
| Translating from MATLAB to C++ | Variable Declaration | ![]() |