Main Content

mxCreateDoubleMatrix (Fortran)

2-D, double-precision, floating-point array

Fortran Syntax

#include "fintrf.h"
mwPointer mxCreateDoubleMatrix(m, n, ComplexFlag)
mwSize m, n
integer*4 ComplexFlag

Description

Use mxCreateDoubleMatrix to create an m-by-n mxArray.

Call mxDestroyArray when you finish using the mxArray. mxDestroyArray deallocates the mxArray and its associated real and imaginary elements.

Input Arguments

expand all

Number of rows, specified as mwSize.

Number of columns, specified as mwSize.

Complex array indicator, specified as an 0 or 1.

For applications built with the mex -R2018a command, the function initializes each data element to 0.

For all other mex release-specific build options, the function sets each element in the pr array. If ComplexFlag is 1, then the function sets the pi array to 0.

Output Arguments

expand all

Pointer to an mxArray of type mxDouble, specified as mwPointer, if successful.

The function is unsuccessful when there is not enough free heap space to create the mxArray.

  • MEX file — Function terminates the MEX file and returns control to the MATLAB® prompt.

  • Standalone (non-MEX file) application — Function returns 0.

Examples

See these examples in matlabroot/extern/examples/refbook:

Version History

Introduced before R2006a