Download 3 - McMaster Physics and Astronomy

Transcript
2
MATLAB Interface to Generic DLLs
Primitive Types
All standard scalar C data types are supported by the shared library interface.
These are shown in the two tables below along with their equivalent MATLAB
types. MATLAB uses the type from the right column for arguments having
the C type shown in the left column.
The second table shows extended MATLAB types in the right column. These
are instances of the MATLAB lib.pointer class rather than standard
MATLAB data types. See “Creating References” on page 2-26 for information
on the lib.pointer class.
MATLAB Primitive Types
C Type (on a 32-bit computer)
Equivalent MATLAB Type
char, byte
int8
unsigned char, byte
uint8
short
int16
unsigned short
uint16
int, long
int32
unsigned int, unsigned long
uint32
float
single
double
double
char *
cstring (1xn char array)
*char[]
cell array of strings
MATLAB Extended Types
2-16
C Type (on a 32-bit computer)
Equivalent MATLAB Type
integer pointer types (int *)
(u)int(size)Ptr
Null-terminated string passed by
value
cstring
Null-terminated string passed by
reference (from a libpointer only)
stringPtr