MATLAB Support for 64-Bit Indexing - MATLAB & Simulink (original) (raw)
Main Content
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 used int
in C/C++ and INTEGER*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 the C Matrix API support 64-bit indexing:
- New types - mwSize and mwIndex - enabling large-sized data.
- Updated C Matrix API functions use
mwSize
andmwIndex
types for inputs and outputs. These functions are called the 64-bit API or the large-array-handling API.
To help transition your MEX files to the 64-bit API, MATLAB maintains an interface, or compatibility layer. To build MEX files with this interface, use the -compatibleArrayDims
flag.
Note
Only variables representing array size or index value require themwSize
or mwIndex
types. The C-language int
data type is valid for variables representing, for example, the number of fields or arrays.