Building Mex file with Fortan
Mostrar comentarios más antiguos
I am trying to understand how to build mex files. I made following test code It compiles using the Visual Fortran Compiler 2011 but when i try to call it matlab shuts down with the message segmentation violation detected. Does anyone sees what goes wrong?
if true
#include <fintrf.h>
C
C Gateway routine
C
SUBROUTINE MEXFUNCTION(NLHS, PLHS, NRHS, PRHS)
C mexFunction arguments:
MWPOINTER PLHS(*), PRHS(*)
MWPOINTER NLHS, NRHS
mwPointer mxGetPr,mxGetPi
mwPointer mxCreateDoubleMatrix,mxCreateNumericArray
mwSize mxGetM, mxGetN
MWPOINTER YPP
REAL *8 RYPP(1)
YPP = MXGETPR(PLHS(1))
RYPP(1) = 10
CALL MXCOPYREAL8TOPTR(RYPP, YPP, 1)
RETURN
END
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!