MATLABSupport for 64-Bit Indexing
MATLAB®Version 7.3 (R2006b) added support for 64-bit indexing. With 64-bit indexing, you can create variables with up to 248-1 elements on 64-bit platforms. Before Version 7.3, the C/C++ and Fortran API Reference library functions usedint
in C/C++ andINTEGER*4
in Fortran to represent array dimensions. These types limit the size of an array to 32-bit integers. Simply building and running MEX files on a 64-bit platform does not guarantee you access to the additional address space. You must update your MEX source code to take advantage of this functionality.
The following changes to theC Matrix APIsupport 64-bit indexing:
To help transition your MEX files to the 64-bit API, MATLAB maintains an interface, orcompatibility layer. To build MEX files with this interface, use the-compatibleArrayDims
flag.
Note
Only variables representing array size or index value require themwSize
ormwIndex
types. The C-languageint
data type is valid for variables representing, for example, the number of fields or arrays.