S Function Builder - To implement existing C code
1 回表示 (過去 30 日間)
古いコメントを表示
Ravikiran Nagaraja
2018 年 10 月 9 日
コメント済み: Ravikiran Nagaraja
2018 年 10 月 16 日
Hello,
I am working on Simulink, S-Function Builder Block. I have a query about that, to explain in brief.
I have a working C code, I have to implement this C code somehow in S-Function Builder block so that the code uses the real-time values from inputs and gives the necessary output according to the action of C code.
My question is where exactly to implement this C code ??
I hope you understand my question, please give me the possible solution.
0 件のコメント
採用された回答
その他の回答 (1 件)
Titus Edelhofer
2018 年 10 月 9 日
Hi Ravikiran,
usually (as long as your working C code has no states) you simply put it into the "outputs" function of the S-function builder. Something like
y0[0] = yourWorkingCode(u0[0], u1[0]);
Titus
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!