필터 지우기
필터 지우기

Converting Aerospace blockset's Gyro model to a C code with Simulink Coder

조회 수: 1 (최근 30일)
amila
amila 2023년 1월 30일
댓글: amila 2023년 2월 8일
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
Mark McBroom 2023년 2월 5일
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.
  댓글 수: 1
amila
amila 2023년 2월 8일
Thank you for the answer.
I think for the additional file main.c is generated with Embedded Coder though(and not with Simulink Coder).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by