solver in the generated code
4 views (last 30 days)
Show older comments
Can you please tell me which targets in Simulink Coder do not have a solver hard coded into the code generated. For example, in the configuration parameters pane of simulink, we select a solver, start time and stop-time. After setting this value, we generate the code. All these settings will be hard coded into the code generated from the GRT target. I do not want the code to include the solver. Is there any way where i can specify not to include the solver? If not, can you please tell me which target generates code without solver?
0 Comments
Answers (1)
Swastik Sarkar
on 23 Jun 2023
In Simulink Coder, the choice of solver and its configuration settings are typically embedded in the generated code to ensure that the simulation behavior is accurately represented in the generated executable or code.
As you want to generate code without the solver being hard-coded into it, you can consider using the "Fixed-Step" solver option and manually remove the solver related components.
The fixed-step solvers use a predetermined step size, eliminating the need to include solver-related code in the generated code.
Another option is to use the embedded coder, which means to use "ert.tlc" as the target.
You can follow this link to Generate code using Embedded Coder
Also make sure to turn off MAT-File Logging, you will see that there will be a main driver c file which calls the step function from model.c infinitely.
0 Comments
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!