Display Help for MATLAB Interface to C++ Library - MATLAB & Simulink (original) (raw)

Use these MATLAB® functions to view information about the members of an interface:

Default Argument Help for Functions and Methods

If a C++ function is defined with default arguments, then you can call the function without providing one or more trailing arguments. The function help shows the default value. For example, if the type of arg is double and its default value is 100, then help displays:

clib.libname.funcname(arg) Input Arguments arg double = 100

Array Size Help for Functions and Methods

If a function or method takes a clib array or a MATLAB array, the generated help text displays size and type information for the argument. For example, a publisher defines a function with this C++ signature:

unsigned int const * fixedMultiFunc(unsigned int [2][3][4] in)

The help for fixedMultiFunc in library interfacedemo is:

clib.demo.fixedMultiFunc Representation of C++ function fixedMultiFunc. RetVal=clib.demo.fixedMultiFunc(in)

 Input Arguments 
  in             2x3x4 clib.array.demo.UnsignedInt   

 Output Arguments 
  RetVal         4 element vector read-only clib.array.demo.UnsignedInt

Both in and RetVal arguments are clib arrays of type UnsignedInt. The size of the in array is2x3x4. The RetVal is a fixed size clib vector with 4 elements. RetVal is also read-only.

The format for the help text for function and method input and output arguments is:

Input/Output Arguments   argname dimension read-only null argtype

dimension Help Text Size Description
n1_x...x_nN Fixed size multidimensional clib array for an_N_ dimensional array, where_n1_,…,nN represents the size for each dimension.
_n_-D array Variable size multidimensional clib array.
n_x_m Fixed size clib matrix, where n and_m_ represent the number of columns and rows in a matrix.
n_x_N N_x_n Variable size clib matrix, where n represents the number of columns or rows in a matrix and N represents a variable number of elements in a dimension.
matrix Variable size clib matrix, where both dimensions of the matrix are variable.
n element Fixed size clib vector, where n represents the fixed number of elements in the vector.
vector Variable size clib vector.
n1_x...x_nN Fixed size MATLAB array for an N dimensional array, where_n1_,…,nN represents the size for each dimension.
n_x_N N_x_n Variable size MATLAB array, where n represents the number of columns or rows in a matrix and N represents a variable number of elements in a dimension.

Display Help for Interface to school Library

If you created the school interface in the example Header-Only HPP File, then you can use it in this example. With the schoolInterface.dll file in the current folder, type:

Display the classes and functions.

then press Tab. This command loads the interface. MATLAB displays a list of members. To view the members, press theBackspace key to remove the period, then press Enter. MATLAB displays:

Classes contained in clib.school: Person - clib.school.Person Representation of C++ class Person Teacher - clib.school.Teacher Representation of C++ class Teacher Student - clib.school.Student Representation of C++ class Student

Functions contained in clib.school: getName - clib.school.getName Representation of C++ function getName

To display the inputs and outputs for the getName function, click thegetName link.

clib.school.getName Representation of C++ function getName Input Arguments p clib.school.Person Output Arguments RetVal string

To display class methods, call the methods function for each class. For example, type:

methods clib.school.Person

Methods for class clib.school.Person:

Person eq ge getAge getName gt le lt ne setAge setName

Methods of clib.school.Person inherited from handle.

To display function signatures, call the methodsview function for each class. For example, type:

methodsview clib.school.Person

The function opens a window that displays the methods and information about arguments and returned values. For example, the signatures for the constructors are:

Name Return Type Arguments
Person clib.school.Person obj (clib.school.Person input1)
Person clib.school.Person obj (name, uint64 scalar age)
Person clib.school.Person obj

See Also

doc | methods | methodsview