Main Content

Define Missing MATLABType Property

R2026b

When defining arguments in a MATLAB® interface, MATLAB automatically converts C++ types to MATLAB types, as described in C++ to MATLAB Data Type Mapping. You can override or specify these mappings when programmatically defining argument behavior.

If the C++ type for the argument is a string, then use these options when specifying values for the MATLABType and Size properties in clibgen.api.InputArgumentDefinition or clibgen.api.OutputArgumentDefinition objects when defining arguments.

This table shows typical mappings and options for string pointer types. The values are applied when defining argument types in the interface definition.

C++ TypeMATLABTypeDirectionOptions for Size
char*a

"int8"

"input"

Scalar value
Array of scalar values

char**
char*[]

"string"

"input"

cell

const char*

"char"

 

Scalar value
Array of scalar values

"string"

"input"

"nullTerminated"

const char**
const char*[]

"char"

"input"

Scalar value
Array of scalar values

"string"

"input"

"nullTerminated"

a These types are equivalent to MATLAB char:

  • wchar_t

  • char16_t

  • char32_t

See Also

Objects

Topics