Embedded coder simulink question: external .c and .h? create S function? use Matlab function block
古いコメントを表示
Hi,
I think I am getting confused with all the products capabilities and which to use.
I would like to create a custom function in a simulink model that calculates a checksum amongst other things. Code is auto generated from the model to run on an arm microcontroller.
Preferably I would like to reuse this function across the model and maybe in futre in other models. What would be the best approach for this?
- Integrate C Code Using the MATLAB Function Block
- Create a wrapper around a .c file to create an S-function <not sure if this is even correct?
- Create a Matlab function to do this (what does the generated code look like, is it ok to do this?)
- Use simulink blocks to do this?
Thanks.
採用された回答
その他の回答 (1 件)
Joe Holdsworth
2018 年 1 月 30 日
0 投票
1 件のコメント
Birdman
2018 年 1 月 30 日
You are welcome, as I said, I would first try to use MATLAB Function.
Actually, to get used to the stuff and see the differences, why don't you implement something simple with Simulink blocks and MATLAB Function? A mathematical expression or else, implement something and generate code from it and see the differences and similarities.
By the way, if my answer helped, can you also accept it?
カテゴリ
ヘルプ センター および File Exchange で Timers and Scheduling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!