Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Ben Milne
Ben Milne le 28 Avr 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?

Réponses (1)

Ayush Gupta
Ayush Gupta le 8 Juin 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.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by