Converting a simulink model (containing a state space block) into a DLL

1 view (last 30 days)
I'm trying to convert a Simple Longitudanal Autopilot for a fixed wing aircraft into a DLL and then call that DLL from a Unity Script for Flight Visualization. I have figured out how to convert a simple simulink model (like sum of two numbers) and convert that into a DLL and call it from Unity.
However, when I try to convert this state space model into a DLL and run it from Unity, it crashes. I have attached a screenshot of the simulink block below:
Furthermore, I suspect the source of the error is coming from this part of the generated code:
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si ,
RT_MODEL_pitchautopilot_T *const pitchautopilot_M, real_T
pitchautopilot_U_Pitch_Input, real_T *pitchautopilot_Y_Angle_of_Attack, real_T
*pitchautopilot_Y_Pitch_Rate, real_T *pitchautopilot_Y_Pitch_Output)
Is this the function I need to call from Unity? And if so, what is the data type of RTWSolverInfo *si?

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!