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

1 次查看(过去 30 天)
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?

回答(1 个)

Ayush Gupta
Ayush Gupta 2020-6-8
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.

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by