访问 Fortran 数据
读取数组中的数据或将数据写入数组
使用这些函数获取有关 MATLAB® 数组的信息(例如维度和大小),以及根据类型检索数据元素。使用这些函数将数据写入 mxArray
变量。
Fortran 函数
数组属性
mxGetNumberOfDimensions | 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 | 数值 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 |
实数
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 |
复数
mxGetComplexDoubles | mxDOUBLE_CLASS 数组中的复数数据元素 |
mxSetComplexDoubles | 在 mxDOUBLE_CLASS 数组中设置复数数据元素 |
mxGetComplexSingles | mxSINGLE_CLASS 数组中的复数数据元素 |
mxSetComplexSingles | 在 mxSINGLE_CLASS 数组中设置复数数据元素 |
mxGetComplexInt8s | mxINT8_CLASS 数组中的复数数据元素 |
mxSetComplexInt8s | 在 mxINT8_CLASS 数组中设置复数数据元素 |
mxGetComplexUint8s | mxUINT8_CLASS 数组中的复数数据元素 |
mxSetComplexUint8s | 在 mxUINT8_CLASS 数组中设置复数数据元素 |
mxGetComplexInt16s | mxINT16_CLASS 数组中的复数数据元素 |
mxSetComplexInt16s | 在 mxINT16_CLASS 数组中设置复数数据元素 |
mxGetComplexUint16s | mxUINT16_CLASS 数组中的复数数据元素 |
mxSetComplexUint16s | 在 mxUINT16_CLASS 数组中设置复数数据元素 |
mxGetComplexInt32s | mxINT32_CLASS 数组中的复数数据元素 |
mxSetComplexInt32s | 在 mxINT32_CLASS 数组中设置复数数据元素 |
mxGetComplexUint32s | mxUINT32_CLASS 数组中的复数数据元素 |
mxSetComplexUint32s | 在 mxUINT32_CLASS 数组中设置复数数据元素 |
mxGetComplexInt64s | mxINT64_CLASS 数组中的复数数据元素 |
mxSetComplexInt64s | 在 mxINT64_CLASS 数组中设置复数数据元素 |
mxGetComplexUint64s | mxUINT64_CLASS 数组中的复数数据元素 |
mxSetComplexUint64s | 在 mxUINT64_CLASS 数组中设置复数数据元素 |
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 |
类
mxGetClassID | Class of mxArray |
mxGetClassName | Class of mxArray as string |
对象
mxGetProperty | Value of public property of MATLAB object |
mxSetProperty | Set value of public property of MATLAB object |
结构体
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 |
稀疏
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 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)