mxGetPr (Fortran)

(Not recommended) Real data elements in mxDOUBLE_CLASS array

mxGetPr is not recommended. Use mxGetDoubles or mxGetComplexDoubles instead. For more information, see Compatibility Considerations.

Fortran Syntax

#include "fintrf.h"
mwPointer mxGetPr(pm)
mwPointer pm

Description

Use mxGetPr on real arrays of type mxDOUBLE_CLASS only. For other numeric mxArray types, use Typed Data Access functions. For complex arrays, see the description for output argument dt.

Call mxIsDouble to validate the mxArray type. Call mxIsComplex to determine whether the data is real.

Input Arguments

expand all

Pointer to a MATLAB array of type mxDOUBLE_CLASS, specified as mwPointer.

Output Arguments

expand all

Pointer to the data array within an mxArray, specified as mwPointer. The data in the output argument depends on which version of the Fortran Matrix API you use:

  • If you build with the separate complex API (mex -R2017b option), then the function returns a pointer to the first mxDouble element of the real part of the data.

  • If you build with the interleaved complex API (mex -R2018a option) and pm is complex, then the function terminates the MEX file and returns control to the MATLAB prompt. In a non-MEX file application, the function returns 0.

If pm is 0, then the function returns 0.

Compatibility Considerations

expand all

Not recommended starting in R2018b

Errors starting in R2018b

Introduced before R2006a