Calls the top level MATLAB(R) function from a source file.

The Call MATLAB Function is expandable and shows data types for the wired inputs and outputs. You can configure the Call MATLAB Function to specify the MATLAB session, source path, and function name.

The Call MATLAB Function is not supported on real-time or FPGA targets.


icon

Inputs/Outputs

  • cgnrn.png session in

    session in specifies a reference to the MATLAB session.

  • cpath.png source file path

    source file path specifies the absolute path to the source .m file.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cpoly.png return type

    return type specifies the data type of return value. You must wire a constant or control matching the data type of the top level MATLAB function return type to return type. For example, if the MATLAB function returns an array of doubles, you must wire an array of doubles constant or control to return type. If the MATLAB function returns multiple values, wire a cluster with elements the correspond to the MATLAB function return values. The name and data types and order of the cluster elements must match the MATLAB function return values. For example, if the MATLAB function returns a numeric, a Boolean array, and a string, you must wire return type to a cluster containing controls or constants of numeric, Boolean array, and string data types in that order. Cluster element names must be unique and not empty. If the MATLAB function does not return any value, leave return type unwired.

  • cpoly.png input parameter

    input parameter specifies the input parameters of the MATLAB function. You must wire the inputs in the order that the function calls them. You can resize the MATLAB Node to add more terminals. You pass a value to the MATLAB function by wiring to the left terminal of a terminal pair. You read the value of a parameter after the function call by wiring from the right terminal of a terminal pair.

  • ignrn.png session out

    session out returns a reference to the MATLAB session.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • ipoly.png return value

    return value is the return value of the MATLAB function. The data type of return value depends on return type.

  • ipoly.png

  • Supported Data Types

    The Call MATLAB Function supports the following data types:

    • Numerics
    • Arrays, including multi-dimensional arrays.
      Note 1D arrays are converted to Row Vectors in MATLAB.
    • Strings
    • Clusters
    • Booleans