MEX with fortran object files

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!

Réponses (1)

Kaustubha Govind
Kaustubha Govind le 6 Juin 2011

0 votes

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.

Catégories

En savoir plus sur Fortran with MATLAB dans Centre d'aide et File Exchange

Question posée :

le 3 Juin 2011

Community Treasure Hunt

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

Start Hunting!

Translated by