Filter löschen
Filter löschen

How to edit C++ code of a Simulink block?

1 Ansicht (letzte 30 Tage)
Ben Milne
Ben Milne am 28 Apr. 2020
Beantwortet: Ayush Gupta am 8 Jun. 2020
Hello,
I've been working on creating a rocket 6DoF and I'm using the 'Simple Variable Mass 6DoF ECEF Quaternion' block from the Aerospace Blockset.
However, after using the Simulink Coder to read the code (generated as C++) I have noticed it uses an ODE2 (Bogacki-Shampine) differential equation solver. My question is: after editing the generated code to upgrade the ODE solver method, how do I go about updating the block itself in my Simulink file?
Does this involve generating an s-function from the 6DoF block -> generating the code -> editing the code -> creating a new s-function block from the edited code?

Antworten (1)

Ayush Gupta
Ayush Gupta am 8 Jun. 2020
There is no need to edit the code of the Simulink block. The ODE Solver can be changed in the Simulink model by going to the Configuration Parameters > Solver > Solver selection and setting the solver to the required one. This will adjust the generated code output to use the required solver.

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by