Access Fortran Data
Use these functions to get information about a MATLAB® array, such as dimension and size, and to retrieve data elements
based on type. Use these functions to write data to mxArray
variables.
Fortran Functions
Array Attribute
mxGetNumberOfDimensions | Number of dimensions in mxArray |
mxGetElementSize | Number of bytes required to store each data element |
mxGetDimensions | Pointer to dimensions array |
mxSetDimensions | Modify number of dimensions and size of each dimension |
mxGetNumberOfElements | Number of elements in numeric mxArray |
mxCalcSingleSubscript | Offset from first element to desired element |
mxGetM | Number of rows in mxArray |
mxSetM | Set number of rows in mxArray |
mxGetN | Number of columns in mxArray |
mxSetN | Set number of columns in mxArray |
Real Numeric
mxGetScalar | Real component of first data element in array |
mxGetDoubles | Real data elements in mxDOUBLE_CLASS array |
mxSetDoubles | Set real data elements in mxDOUBLE_CLASS array |
mxGetSingles | Real data elements in mxSINGLE_CLASS array |
mxSetSingles | Set real data elements in mxSINGLE_CLASS array |
mxGetInt8s | Real data elements in mxINT8_CLASS array |
mxSetInt8s | Set real data elements in mxINT8_CLASS array |
mxGetUint8s | Real data elements in mxUINT8_CLASS array |
mxSetUint8s | Set real data elements in mxUINT8_CLASS array |
mxGetInt16s | Real data elements in mxINT16_CLASS array |
mxSetInt16s | Set real data elements in mxINT16_CLASS array |
mxGetUint16s | Real data elements in mxUINT16_CLASS array |
mxSetUint16s | Set real data elements in mxUINT16_CLASS array |
mxGetInt32s | Real data elements in mxINT32_CLASS array |
mxSetInt32s | Set real data elements in mxINT32_CLASS array |
mxGetUint32s | Real data elements in mxUINT32_CLASS array |
mxSetUint32s | Set real data elements in mxUINT32_CLASS array |
mxGetInt64s | Real data elements in mxINT64_CLASS array |
mxSetInt64s | Set data elements in mxINT64_CLASS array |
mxGetUint64s | Real data elements in mxUINT64_CLASS array |
mxSetUint64s | Set real data elements in mxUINT64_CLASS array |
mxGetData | Data elements in nonnumeric mxArray |
mxSetData | Set pointer to data elements in nonnumeric
mxArray |
mxGetPr | (Not recommended) Real data elements in mxDOUBLE_CLASS
array |
mxSetPr | (Not recommended) Set real data elements in mxDOUBLE_CLASS
array |
Complex Numeric
mxGetComplexDoubles | Complex data elements in mxDOUBLE_CLASS array |
mxSetComplexDoubles | Set complex data elements in mxDOUBLE_CLASS
array |
mxGetComplexSingles | Complex data elements in mxSINGLE_CLASS array |
mxSetComplexSingles | Set complex data elements in mxSINGLE_CLASS
array |
mxGetComplexInt8s | Complex data elements in mxINT8_CLASS array |
mxSetComplexInt8s | Set complex data elements in mxINT8_CLASS array |
mxGetComplexUint8s | Complex data elements in mxUINT8_CLASS array |
mxSetComplexUint8s | Set complex data elements in mxUINT8_CLASS array |
mxGetComplexInt16s | Complex data elements in mxINT16_CLASS array |
mxSetComplexInt16s | Set complex data elements in mxINT16_CLASS array |
mxGetComplexUint16s | Complex data elements in mxUINT16_CLASS array |
mxSetComplexUint16s | Set complex data elements in mxUINT16_CLASS
array |
mxGetComplexInt32s | Complex data elements in mxINT32_CLASS array |
mxSetComplexInt32s | Set complex data elements in mxINT32_CLASS array |
mxGetComplexUint32s | Complex data elements in mxUINT32_CLASS array |
mxSetComplexUint32s | Set complex data elements in mxUINT32_CLASS
array |
mxGetComplexInt64s | Complex data elements in mxINT64_CLASS array |
mxSetComplexInt64s | Set complex data elements in mxINT64_CLASS array |
mxGetComplexUint64s | Complex data elements in mxUINT64_CLASS array |
mxSetComplexUint64s | Set complex data elements in mxUINT64_CLASS
array |
mxGetImagData | Imaginary data elements in numeric mxArray |
mxSetImagData | Set imaginary data elements in numeric mxArray |
mxGetPi | (Not recommended) Imaginary data elements in mxDOUBLE_CLASS
array |
mxSetPi | (Not recommended) Set imaginary data elements in
mxDOUBLE_CLASS array |
Class
mxGetClassID | Class of mxArray |
mxGetClassName | Class of mxArray as string |
Object
mxGetProperty | Value of public property of MATLAB object |
mxSetProperty | Set value of public property of MATLAB object |
Structure
mxGetField | Pointer to field value from structure array, given index and field name |
mxSetField | Set field value in structure array, given index and field name |
mxGetNumberOfFields | Number of fields in structure array |
mxGetFieldNameByNumber | Pointer to field name from structure array, given field number |
mxGetFieldNumber | Field number from structure array, given field name |
mxGetFieldByNumber | Pointer to field value from structure array, given index and field number |
mxSetFieldByNumber | Set field value in structure array, given index and field number |
mxAddField | Add field to structure array |
mxRemoveField | Remove field from structure array |
Sparse
mxGetNzmax | Number of elements in IR, PR, and PI arrays |
mxSetNzmax | Set storage space for nonzero elements |
mxGetIr | Sparse matrix IR array |
mxSetIr | IR array of sparse array |
mxGetJc | Sparse matrix JC array |
mxSetJc | JC array of sparse array |
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- 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)