define
R2026bDescription
define(
defines or customizes a property with one or more name-value arguments.propDef,Name=Value)
Examples
Use the define method on a
clibgen.api.PropertyDefinition object to resolve incomplete pointer
properties by specifying MATLABType and Size
properties.
Configure the interface for a library defined by
propertyDef.hpp.
icfg = clibgen.api.InterfaceConfiguration("libname"); icfg.HeaderFiles = "propertyDef.hpp"; idef = clibgen.api.InterfaceDefinition(icfg);
Display information about the rawBuffer property in the
Sensor class.
sensorClass = idef.findClass("Sensor"); prop = sensorClass.findProperty("rawBuffer")
ans =
PropertyDefinition with properties:
CPPName: "rawBuffer"
CPPType: "double *"
MATLABType: "clib.array.libname.Double"
Size: <undefined>
Status: Incomplete
Included: false
point
Show all properties
Define rawBuffer as a double array whose length the
bufferLength data member specifies.
define(prop,MATLABType="double",Size="bufferLength")
Verify the update.
prop
prop =
PropertyDefinition with properties:
CPPName: "rawBuffer"
CPPType: "double *"
MATLABType: "double"
Size: "bufferLength"
Status: Complete
Included: true
Show all properties
Input Arguments
C++ property definition, specified as a clibgen.api.PropertyDefinition object with one or more name-value
arguments.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example:
Data type for the argument in MATLAB®, specified as a string scalar.
Dimensions of array data, specified as a numeric vector, string vector, cell
array, or "nullTerminated". MATLAB uses this value to determine the
number of elements in the pointer data. For example:
If
Size= 1, the pointer refers to a single element.If
Size= 5, the pointer refers to an array of exactly five elements.If
Size="len", the number of elements in the array equals the value of the data member"len".If
Size=["m","n"], the pointer refers to a matrix with the number of elements in each dimension equal to the values of the data members"m"and"n".If
Size="nullTerminated", the pointer refers to a C++ string.
Doxygen @brief comments for the property from the header file,
specified as a string scalar.
Doxygen @details comments for the property from the header
file, specified as a string scalar. If the C++ file does not contain a comment about
the property, then DetailedDescription is empty and does not
appear in the definition file.
Version History
Introduced in R2026b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)