Main Content

Define Missing Constructs

When you created the library definition file to the matrixOperations library in the previous step, MATLAB® reported that five constructs are partially defined. To completely define the functionality, edit the definematrixlib.m file. If you have not yet opened the file, you can click the link in the output message to open it in the editor.

C++ compiler set to 'MinGW64 Compiler (C++)'.
Definition file definematrixOperations.m contains definitions for 10 constructs supported by MATLAB.
- 5 constructs are fully defined.
- 5 constructs partially defined and commented out.

To include the 5 undefined constructs in the interface, uncomment and complete the definitions in definematrixOperations.m.
To build the interface, call build(definematrixOperations).

Scroll through the library definition file open in your editor to find blocks of commented code for these constructs.

MATLAB cannot automatically determine the size of arguments used by these functions.

  • setMat - C++ method for class Mat

  • getMat - C++ method for class Mat

  • copyMat - C++ method for class Mat

  • addMat - C++ package function

  • updateMatBySize - C++ package function

Based on the documentation of the matrixOperations library, you can provide values for <SHAPE> in the argument definition statements. For more information, see Define Missing SHAPE Parameter.

  1. For each construct, uncomment the statements defining it.

  2. Replace <SHAPE> arguments with these values.


    Argument Name

    Argument C++ Definition


    Replace <SHAPE> with Value

    setMatsrcint [] src

    The length of the matrix is defined by the input argument len.

    getMatRetValint const *

    The length of the output argument is defined by the input argument len.

    copyMatdestint * dest

    The length dest is defined by the input argument len.

    addMatmatMat const * mat

    The function takes a single mat argument.

    updateMatBySizearrint * arr

    The length arr is defined by the input argument len.

  3. Save and close the definition file.

  4. Continue with the next step.

Related Topics