필터 지우기
필터 지우기

Force C-code recompile in Simulink

조회 수: 1 (최근 30일)
Thomas
Thomas 2017년 1월 14일
답변: Thomas 2017년 1월 15일
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
Thomas
Thomas 2017년 1월 15일
편집: Thomas 2017년 1월 15일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Thomas
Thomas 2017년 1월 15일
After using the function that I've mentioned in my comment, I think that I have answered my problem.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by