MEX with fortran object files

14 visualizaciones (últimos 30 días)
Aaron
Aaron el 3 de Jun. de 2011
Hi,
I have a fortran program that has a bunch of subroutines written. The code has go tos, etc..., so f2m programs have not been successful. I have investigated compiling the fortran code using mex within MATLAB, but have not been successful.
Alas, I have compiled the fortran script (subroutines.f) into (subroutines.o) object file using f77 compiler on a unix machine. Is there a way to use this object file inside MATLAB to call the functions defined in the fortran program, as if they were functions written in MATLAB?
If so, can someone post an example / tutorial on how to do this?
Thanks!

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 6 de Jun. de 2011
You need to write a gateway C/FORTRAN MEX-function that calls into your object file. The documentation has a description and examples for such a function.

Categorías

Más información sobre Fortran with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by