Main Content

访问 Fortran 数据

读取数组中的数据或将数据写入数组

使用这些函数获取有关 MATLAB® 数组的信息(例如维度和大小),以及根据类型检索数据元素。使用这些函数将数据写入 mxArray 变量。

Fortran 函数

全部展开

mxGetNumberOfDimensionsmxArray 中的维数
mxGetElementSizeNumber of bytes required to store each data element
mxGetDimensionsPointer to dimensions array
mxSetDimensionsModify number of dimensions and size of each dimension
mxGetNumberOfElements数值 mxArray 中的元素数
mxCalcSingleSubscriptOffset from first element to desired element
mxGetMNumber of rows in mxArray
mxSetMSet number of rows in mxArray
mxGetNNumber of columns in mxArray
mxSetNSet number of columns in mxArray
mxGetScalarReal component of first data element in array
mxGetDoublesReal data elements in mxDOUBLE_CLASS array
mxSetDoublesSet real data elements in mxDOUBLE_CLASS array
mxGetSinglesReal data elements in mxSINGLE_CLASS array
mxSetSinglesSet real data elements in mxSINGLE_CLASS array
mxGetInt8sReal data elements in mxINT8_CLASS array
mxSetInt8sSet real data elements in mxINT8_CLASS array
mxGetUint8sReal data elements in mxUINT8_CLASS array
mxSetUint8sSet real data elements in mxUINT8_CLASS array
mxGetInt16sReal data elements in mxINT16_CLASS array
mxSetInt16sSet real data elements in mxINT16_CLASS array
mxGetUint16sReal data elements in mxUINT16_CLASS array
mxSetUint16sSet real data elements in mxUINT16_CLASS array
mxGetInt32sReal data elements in mxINT32_CLASS array
mxSetInt32sSet real data elements in mxINT32_CLASS array
mxGetUint32sReal data elements in mxUINT32_CLASS array
mxSetUint32sSet real data elements in mxUINT32_CLASS array
mxGetInt64sReal data elements in mxINT64_CLASS array
mxSetInt64sSet data elements in mxINT64_CLASS array
mxGetUint64sReal data elements in mxUINT64_CLASS array
mxSetUint64sSet real data elements in mxUINT64_CLASS array
mxGetDataData elements in nonnumeric mxArray
mxSetDataSet 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
mxGetComplexDoublesmxDOUBLE_CLASS 数组中的复数数据元素
mxSetComplexDoublesmxDOUBLE_CLASS 数组中设置复数数据元素
mxGetComplexSinglesmxSINGLE_CLASS 数组中的复数数据元素
mxSetComplexSinglesmxSINGLE_CLASS 数组中设置复数数据元素
mxGetComplexInt8smxINT8_CLASS 数组中的复数数据元素
mxSetComplexInt8smxINT8_CLASS 数组中设置复数数据元素
mxGetComplexUint8smxUINT8_CLASS 数组中的复数数据元素
mxSetComplexUint8smxUINT8_CLASS 数组中设置复数数据元素
mxGetComplexInt16smxINT16_CLASS 数组中的复数数据元素
mxSetComplexInt16smxINT16_CLASS 数组中设置复数数据元素
mxGetComplexUint16smxUINT16_CLASS 数组中的复数数据元素
mxSetComplexUint16smxUINT16_CLASS 数组中设置复数数据元素
mxGetComplexInt32smxINT32_CLASS 数组中的复数数据元素
mxSetComplexInt32smxINT32_CLASS 数组中设置复数数据元素
mxGetComplexUint32smxUINT32_CLASS 数组中的复数数据元素
mxSetComplexUint32smxUINT32_CLASS 数组中设置复数数据元素
mxGetComplexInt64smxINT64_CLASS 数组中的复数数据元素
mxSetComplexInt64smxINT64_CLASS 数组中设置复数数据元素
mxGetComplexUint64smxUINT64_CLASS 数组中的复数数据元素
mxSetComplexUint64smxUINT64_CLASS 数组中设置复数数据元素
mxGetImagDataImaginary data elements in numeric mxArray
mxSetImagDataSet 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
mxGetClassIDClass of mxArray
mxGetClassNameClass of mxArray as string
mxGetPropertyValue of public property of MATLAB object
mxSetPropertySet value of public property of MATLAB object
mxGetFieldPointer to field value from structure array, given index and field name
mxSetFieldSet field value in structure array, given index and field name
mxGetNumberOfFieldsNumber of fields in structure array
mxGetFieldNameByNumberPointer to field name from structure array, given field number
mxGetFieldNumberField number from structure array, given field name
mxGetFieldByNumberPointer to field value from structure array, given index and field number
mxSetFieldByNumberSet field value in structure array, given index and field number
mxAddFieldAdd field to structure array
mxRemoveFieldRemove field from structure array
mxGetCellPointer to element in cell array
mxSetCellSet contents of cell array
mxGetNzmaxNumber of elements in IR, PR, and PI arrays
mxSetNzmaxSet storage space for nonzero elements
mxGetIrSparse matrix IR array
mxSetIrIR array of sparse array
mxGetJcSparse matrix JC array
mxSetJcJC array of sparse array