mwPointer (Fortran) - Fortran pointer type - MATLAB (original) (raw)
Main Content
Description
The mwPointer
preprocessor macro declares the appropriate Fortran type representing a pointer to an mxArray
, the fundamental type underlying MATLABĀ® data. The Fortran header file containing this macro is:
The Fortran preprocessor translates mwPointer
to the Fortran declaration that is appropriate for the platform on which you compile your file. On 64-bit platforms, the Fortran type that represents a pointer isINTEGER*8
. On 32-bit platforms, the type isINTEGER*4
. If your Fortran compiler supports preprocessing, you can use mwPointer
to declare functions, arguments, and variables that represent pointers. If you cannot use mwPointer
, then ensure that your declarations have the correct size for the platform on which you are compiling Fortran code.
Examples
This example declares the arguments for mexFunction in a Fortran MEX file.
subroutine mexFunction(nlhs, plhs, nrhs, prhs) mwPointer plhs(), prhs() integer nlhs, nrhs
For additional examples, see the Fortran files with names ending in.F
in the_`matlabroot`_/extern/examples
folder.
Version History
Introduced in R2006a