Arguments that have more than one level of referencing (e.g.,
uint16 **) are referred to here as reference pointers. In MATLAB, these argument types are named with the suffix
PtrPtr (for example,
uint16PtrPtr). See the output of
-full for examples of this type.
When calling a function that takes a reference pointer argument, you can use a reference argument instead and MATLAB will convert it to the reference pointer. For example, the external
allocateStruct function expects a
Here is the C function:
Although the prototype says that a
c_structPtrPtr is required, you can use a
c_structPtr and let MATLAB do the second level of conversion. Create a reference to an empty structure argument and pass it to
When you are done, return the memory that you had allocated:
|Creating References||Calling C and Fortran Programs from MATLAB|
© 1994-2005 The MathWorks, Inc.