How Can I Run a Mex file in Simulink

6 Ansichten (letzte 30 Tage)
DONGHUN LEE
DONGHUN LEE am 14 Sep. 2020
Bearbeitet: Fayez Alruwaili am 23 Mär. 2021
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?

Antworten (1)

Monisha Nalluru
Monisha Nalluru am 17 Sep. 2020
Bearbeitet: Monisha Nalluru am 17 Sep. 2020
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 Kommentar
Fayez Alruwaili
Fayez Alruwaili am 23 Mär. 2021
Bearbeitet: Fayez Alruwaili am 23 Mär. 2021
This is very slow, is there any alternative way doing it?
Thanks

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by