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.
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?
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!