Converting Aerospace blockset's Gyro model to a C code with Simulink Coder
显示 更早的评论
Hello!
I'm trying to generated C codes for the Aerospace blockset's Gyro model using Simulink Coder and incorporate it to an already existing C program.
Are there some examples which I can follow to see how to incorporate generated C codes into a different program ?
回答(1 个)
Mark McBroom
2023-2-5
1 个投票
Integrating generated code from a Simulink model into another application is fairly simple. When you generate code for your simulink model, an adidtional file main.c will be generated that shows you how to call the 2 key functions genreated from the Simulink model, the initialize() function and the step() function. Dpending on how you set up the code generation options, the initialize() and step() functions will be either void-void or they will take arguments for the inputs, outputs, states and parameters in the model. In either case, the main.c will show you the proper way to call these functions.
类别
在 帮助中心 和 File Exchange 中查找有关 Aerospace Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!