Include s-function c-code into fortran program

조회 수: 1 (최근 30일)
Etienne Coetzee
Etienne Coetzee 2013년 9월 10일
I have a fortran mex function that calls a matlab function. This function calls a Simulink model and obtains the derivatives. The mexCallMatlab function slows down the calculations significantly, hence I would like to use code generated from the Simulink model, and then interface this to the fortran program. I do however not know how to do this, so any examples would be useful. Thanks in advance.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 9월 11일
I'm not a FORTRAN programmer, so I can't give advice on the mechanics of interfacing between FORTRAN and C (although that question might be suitable for FORTRAN forums), but you can use the Embedded Coder product to generate Shared Libraries from your Simulink model. Since the generated code is standard C, you can interface the generated library from your FORTRAN code just like any other C shared library.

추가 답변 (0개)

카테고리

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