I want to call hand coded C functions from Stateflow and generate code.

1 回表示 (過去 30 日間)
Seth Appleman
Seth Appleman 2020 年 1 月 15 日
回答済み: Jorge Calvo 2021 年 12 月 2 日
I have a Stateflow model that I am using to generate a state machine that will be integrated into a larger code product being developed in a Linux environment. I want the state blocks to call C functions that are defined in external header files, which I am hand coding. I don't need the Stateflow figure to run in simulation in Matlab. I just want the C code that calls my manual C functions as part of the generated state machine. How do I do this, including what I need to fill in in the "Import Custom Code" section of the model settings?
Currently, I am getting compile errors in Matlab when trying to pull in the custom code, which is including several header files for doing unrelated activities the state machine doesn't need to care about. The manual C code compiles and runs fine on its own.

回答 (1 件)

Jorge Calvo
Jorge Calvo 2021 年 12 月 2 日
Hi Seth,
Sounds like you need to configure your custom code for code generation. This help topic might help. Pay particular attention to the section on code generation.
Cheers,
Jorge

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by