How can I create a Mex function from a generated C code from Simulink Coder?

2 ビュー (過去 30 日間)
Charles Pimenta
Charles Pimenta 2018 年 10 月 1 日
編集済み: TAB 2018 年 10 月 2 日
I'm working on a big simulink model, that needs a long time to run and simulate. I'm looking for a way to reduce the time to run. I think in use the simulink coder to generate C code from my model and after compile it in a MEX function to make the model a callable function to matlab scripts. May be it possible ? Some one have experience in do it ?

採用された回答

TAB
TAB 2018 年 10 月 2 日
編集済み: TAB 2018 年 10 月 2 日
Simulink model (and also generated code) is designed to run on a solver which is part of Simulink tool but not present in Matlab. So running a mex file generated from Simulink model in Matlab is not a good idea.
To solve your long simulation time problem, you can refer many other options like Accelerator, Mode, Rapid Accelerator mode etc.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by