Display Help for MATLAB Interface to C++ Library
Use these MATLAB® functions to view information about the members of an interface:
doc
andhelp
— View classes and functions in an interface. When you publish an interface, you can add descriptive text. For more information, see Publish Help Text for MATLAB Interface to C++ Library.methods
— View constructor, method, and function names for a class.methods
with'-full'
option — View constructor, method, and function signatures.methodsview
— Table representation of method signatures. You might find themethodsview
window easier to use as a reference guide because you do not need to scroll through the Command Window to find information.
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 interface
demo
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 is
2x3x4
. 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 dimensionread-only
null
argtype
argname
is the argument name.The
dimension
help text describes the size of the argument. For more information, see the following table.If the array is
const
, then the help displays the textread-only
.If the array is null, then the help displays the text
null
.The
argtype
text displaysclib.array.
for clib arrays, andlibname
.type
mltype
for MATLAB arrays, wherelibname
is the interface library name,type
is a C++ type, andmltype
is a MATLAB type.
dimension Help Text | Size Description |
---|---|
| Fixed size multidimensional clib array for an
|
| Variable size multidimensional clib array. |
| Fixed size clib matrix, where |
| Variable size clib matrix, where |
matrix | Variable size clib matrix, where both dimensions of the matrix are variable. |
| Fixed size clib vector, where |
vector | Variable size clib vector. |
| Fixed size MATLAB array for an |
| Variable size MATLAB array, where |
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:
addpath('.')
Display the classes and functions.
doc clib.school.
then press Tab. This command loads the interface. MATLAB displays a list of members. To view the members, press the Backspace 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 the
getName
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