The MEX file doesn't speed up the simulation

1 view (last 30 days)
Gaetano
Gaetano on 2 Jul 2020
Commented: Gaetano on 2 Jul 2020
Hi,
For speed up my simulation I generated the MEX file of Output_fcn.m (with Matlab coder).
The first image (below) is the profiler without the MEX file (originally version).
The second image (below) is the profiler replacing the function with the MEX file, but the total simulation time has increased so much.
Why the Self time of the MEX-file is very high?
The Output_fcn.m is not complex and inside it has simple assignments.
Edit: I added the Output_fcn.m script. Below the input
Many thanks
  2 Comments
Rik
Rik on 2 Jul 2020
I don't know how to diagnose this, but I can imagine it would be relevant to have the code in question. You can attach it to your question with the paperclip icon.
Gaetano
Gaetano on 2 Jul 2020
Thanks for the reply.
I attached the file in the question

Sign in to comment.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!