Command line build stopped working - picking wrong encoder by the looks of it...

조회 수: 2 (최근 30일)
Simon
Simon 2024년 4월 2일
답변: Harimurali 2024년 5월 8일
matlab.exe -sd "build" -batch "build('$master_model')" | ForEach-Object { "[" + (Get-Date -Format "HH:mm:ss.fff") + "] $_" }
Been running this successfully for a while, but getting error now about "Matlab Coder", when we actually want/need to use Embedded Coder.,
Can anyone help me where the coder is specified and how to change it or am I barking up wrong tree.
Matlab 2021b - and problems seemed to start when we had new licence file from 1st April this year...

답변 (1개)

Harimurali
Harimurali 2024년 5월 8일
Hi Simon,
My understanding is that the command:
matlab.exe -sd "build" -batch "build('$master_model')" | ForEach-Object { "[" + (Get-Date -Format "HH:mm:ss.fff") + "] $_"
is a command-line instruction that executes MATLAB in batch mode, with the starting directory as "build", to run a script or function called "build" with the input argument "$master_model", where "master_model" is an environment variable that contains the name of your model.
The issue seems to be caused by the "build" function. You can build a Simulink model using the "slbuild" function after configuring the model to use Embedded Coder by following the given steps:
  • Open the model, go to "Model Settings" in the "MODELING" tab.
  • In "Model Settings" window, go to the "Code Generation" section and set the "System target file" as "ert.tlc".
  • In the "build" function, use the "slbuild" function. If you are using the "rtwbuild" function, use the "slbuild" function as use of "rtwbuild" function is not recommended after MATLAB R2021a version.
Please refer the following MATLAB Answer for more details about the "slbuild" and "rtwbuild" functions in MATLAB: https://www.mathworks.com/matlabcentral/answers/557818-what-is-the-difference-between-slbuild-and-rtwbuild
Hope this resolves your issue!

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by