Filter löschen
Filter löschen

Force C-code recompile in Simulink

6 Ansichten (letzte 30 Tage)
Thomas
Thomas am 14 Jan. 2017
Beantwortet: Thomas am 15 Jan. 2017
Hi Guys,
I've been able to create a Simulink model, which utilizes some C++ code that I have created; code that will generate sine/cosine from input radians. Within the code, I have a #define which will vary how accurate the generated sine/cosine output is. Currently, if I run the model, it works as expected, if I then change the value of this #define, Simulink doesn't then re-compile the updated code. The only way that I have found which forces this re-compile, is if I go into the "Configuration parameters" and delete the include files within "Simulation Target\Header file", apply, and then run the model. Which will then result in the use of the new #define value.
Is there any setting, that I am missing, which will force a re-compile of the C-code when I run the model?
  1 Kommentar
Thomas
Thomas am 15 Jan. 2017
Bearbeitet: Thomas am 15 Jan. 2017
Have had a major play on this issue, and believe that I have found a way around this. I've created a function which will look within the working directory for a '.mexw64' file, and delete it (as this contains the compiled code). This as been configured such that it runs at initialisation of my model and voila, everytime that I change my C++ code and then run my model it retrieved the latest version! Note entirely sure if this is the correct way to fix this problem, but it appears to be working

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Thomas
Thomas am 15 Jan. 2017
After using the function that I've mentioned in my comment, I think that I have answered my problem.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by