MEX with fortran object files

조회 수: 14 (최근 30일)
Aaron
Aaron 2011년 6월 3일
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!

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2011년 6월 6일
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.

카테고리

Help CenterFile Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by