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.mlx file. If you have not yet opened the file, you can click the link in the output message to open it in Live Editor.

Definition file definematrixlib.mlx contains definitions for 10 constructs supported by MATLAB.
- 5 construct(s) are fully defined.
- 5 construct(s) partially defined and commented out.

To include the 5 undefined construct(s) in the interface, uncomment and complete the definitions in definematrixlib.mlx.
To build the interface, call build(definematrixlib).

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.

    Construct

    Argument Name

    Argument C++ Definition

    Description

    Replace <SHAPE> with Value

    setMatsrcint [] src

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

    "len"
    getMatRetValint const *

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

    "len"
    copyMatdestint * dest

    The length dest is defined by the input argument len.

    "len"
    addMatmatMat const * mat

    The function takes a single mat argument.

    1
    updateMatBySizearrint * arr

    The length arr is defined by the input argument len.

    "len"
  3. Save and close the definition file.

  4. Continue with the next step.