Use of Simulink-generated MEX function within MATLAB

5 ビュー (過去 30 日間)
Ioannis Sarris
Ioannis Sarris 2015 年 4 月 16 日
コメント済み: Simon Meyer 2020 年 9 月 28 日
Assume that you have a MATLAB function that generates a waveform (vector A) and a Simulink model that represents a combination of filters.
Is there any way, by which, the Simulink model can be invoked through MATLAB as a MEX function (eg B = sim_func_mex(A)) in order to pass the waveform through the filters and obtain the output (vector B) WITHOUT opening Simulink (ie without issuing a sim() command) and without requiring a Simulink license?
This scenario is very common, where a number of people need to work on a MATLAB function but DO NOT need access (i.e. they do not need to view/modify) the Simulink model.
Any help would be very much appreciated.
Regards, Ioannis

回答 (2 件)

Titus Edelhofer
Titus Edelhofer 2015 年 4 月 16 日
Hi Ioannis,
if you have Simulink Coder available, you can convert your Simulink model to C Code (and create either an executable or a dll). This you (other users) can call then from MATLAB without the need of Simulink. What you need though is the license for Simulink Coder ...
Titus

Ioannis Sarris
Ioannis Sarris 2015 年 4 月 16 日
Thanks Titus for your answer. I have thought of this possibility but I would expect that a simpler solution should be possible, since this requires building a MEX wrapper for the C-code and compiling it. At the end of the day, Simulink creates a MEX file of your model in Accelerated mode, so why is it not possible to reuse that?
Thanks again.
  1 件のコメント
Simon Meyer
Simon Meyer 2020 年 9 月 28 日
Hello Ioannis,
currently I am struggeling with the same problem. I know this post is pretty old, but did you find any good way to solve this issue, or can you give any advice for me?
Thank you very much!
Simon

サインインしてコメントする。

カテゴリ

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