matlab mwpointer函数语法

发表matlab mwpointer函数相关文章
一句话说明: Platform-independent pointer type

mwPointer (Fortran)

Platform-independent pointer type


mwPointer is a preprocessor macro that declares the appropriate Fortran type representing a pointer to an mxArray or to other data that is not of a native Fortran type, such as memory allocated by mxMalloc. On 32-bit platforms, the Fortran type that represents a pointer is INTEGER*4; on 64-bit platforms, it is INTEGER*8. The Fortran preprocessor translates mwPointer to the Fortran declaration that is appropriate for the platform on which you compile your file.

If your Fortran compiler supports preprocessing, you can use mwPointer to declare functions, arguments, and variables that represent pointers. If you cannot use mwPointer, you must ensure that your declarations have the correct size for the platform on which you are compiling Fortran code.

The Fortran header file containing this type is:

#include "fintrf.h"


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.


与matlab mwpointer用法相关的文章

友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1