Embedded coder on m-files (without simulink)
古いコメントを表示
Is matlab coder and embedded coder suitable to generate c code (for embedded target) from an m-file, and if so, how? I only find examples involving simulink, but is there a way to do this from command line (achieving rtwbuild with ert on m-file only).
If done form within Simukink om an Matlab System block only, is Simulink coder necessary?
採用された回答
その他の回答 (2 件)
Denis Gurchenkov
2019 年 1 月 28 日
1 投票
MATLAB Coder is exacrtly the tool that takes an .m file and genrates C code from it. If all you want is MATLAB-to-C conversion, then you don't need Simulink or Simulink Coder at all. If you go to https://www.mathworks.com/products/matlab-coder.html and start from there, there are tutorials, webinars and all that reachable from that page (you do need to create a free MathWorks account to get to the doc, though).
If you have a Simulink model with a single MATLAB Function Block in it and you want to generate C code, then you do need Simulink Coder. But if you took the body of that block, saved it in an .m file, then you could feed that file to MATLAB Coder and then you don't need Simulink Coder.
Andreas Johansson
2019 年 1 月 29 日
0 投票
1 件のコメント
Denis Gurchenkov
2019 年 1 月 29 日
If you have a license for Embedded Coder, it unlocks extra features in both SL and ML Coders, allowing for greater customization of generated code (things like naming style for variables). You can always generate C code without Embedded Coder (via either SL or ML coder, depending on your source language -- Simulink or MATLAB), and Embedded Coder only is necessary if there is some particular feature (like code customization, interfacing with extrenal C code etc) that you need -- many such features get unlocked / become visible in configuration menus only if Embedded Coder license is available.
Can you elaborate on what you mean by "embedded coder can be hooked on to this chain"? If you have both ML and Embedded Coder licenses, they would work together just fine, but the real question is, what is the feature or capability of Embedded Coder that you really need.
To sum it up, perhaps you should try first to generate C code using ML coder alone. If taht works (C code is generated and does what you want) then you decide if you want/need to try EC or not.
カテゴリ
ヘルプ センター および 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!