How Can I Run a Mex file in Simulink

조회 수: 4 (최근 30일)
DONGHUN LEE
DONGHUN LEE 2020년 9월 14일
편집: Fayez Alruwaili 2021년 3월 23일
On the script, the mex.file that are working wel but,l
Is there a solution for not recognizing the mex file in the syntax using the matlabfunction block on Simulink?

답변 (1개)

Monisha Nalluru
Monisha Nalluru 2020년 9월 17일
편집: Monisha Nalluru 2020년 9월 17일
In MATLAB function block the compiler expects the MATLAB code, but when it comes to mexfile, finds the code in binary mex file, which it cannot handle.
So add the below code in MATLAB function block bbefore calling mex file
coder.extrinsic('mex_filename');
If you declare it extrinsic, the compiler never tries to compile mexfile, just sets up a call to it.
  댓글 수: 1
Fayez Alruwaili
Fayez Alruwaili 2021년 3월 23일
편집: Fayez Alruwaili 2021년 3월 23일
This is very slow, is there any alternative way doing it?
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by