How to Generate C code of Continuous time blocks?
6 ビュー (過去 30 日間)
古いコメントを表示
Hey Everyone, I want to know how should i generate C code from models that are utilizing continuous time blocks such as transformers?
0 件のコメント
回答 (1 件)
SRance
2020 年 11 月 17 日
Each Simulink block or MATLAB functions defines whether or not it can be generated to C/C++ code, which can be checked against the general list of MATLAB supported functions for code generation or with each block, listed at the bottom of the help page for that function of block. I.e. even if you wrote a MATLAB function for Simulink, it doens't neccessarily mean the function can be converted to C code.
For C code it is good to avoid continuous states as much as possible so that you can control the discrete time steps of your model when it is deployed to hardware, else you are likely to run into overflow quite quickly.
Use the Debug tab in Simulink to check the discrete and continous parts of your model, noting that for most continuous blocks there is a discrete alternative.
Once your are happy with you model, simply set-up your model to generate code for your specific hardware, noting you will need the Embedded or Simulink coder, or relevant support package for Arduino or Raspberry Pi.
0 件のコメント
参考
カテゴリ
Help Center および File 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!