Clear Filters
Clear Filters

solver in the generated code

1 view (last 30 days)
archana b m
archana b m on 13 Mar 2013
Answered: Swastik on 23 Jun 2023
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?

Answers (1)

Swastik
Swastik 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.
You can go here to make the suitable choice of solver.
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.

Categories

Find more on Deployment, Integration, and Supported Hardware 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!