C++ Math Library Reference    

Translating MATLAB Syntax into C++ Syntax

This procedure translates the MATLAB call [U,S,V] = svd(X,0) into a C++ call. The procedure applies to library functions in general.

Note that within a call to a MATLAB C++ Math Library function, an output argument is preceded by &; an input argument is not.

  1. Declare input, output, and return variables as mwArray variables, and assign values to the input variables.
  2. Make the first MATLAB output argument the return value from the function.
  3. Pass any other output arguments as the first arguments to the function.
  4. Pass the input arguments to the C++ function, following the output arguments.

The translation is complete.

Note that if you see [] as a MATLAB input argument, you should pass mwArray() as the C++ argument. For example,

    becomes


 Constructing a C++ Prototype The mwArray Class