フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What's the correct scheduling of calling C functions of a Simulink model after Simulink Coder conversion?

1 回表示 (過去 30 日間)
Bo Wang
Bo Wang 2016 年 1 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I've used Simulink to build a subsystem and converted it into C using Simulink Coder. Then I will write my main function where the subsystem's C functions (mdlOutput(), mdlUpdate(), etc) will be called, as follows:
/* scheduling 1*/
main()
{
...
for (i=0;i<100;i++)
{
mdlOutput();
mdl_U = 1-mdl_Y; /* updating input using output */
mdlUpdate();
}
...
}
You can see that a feedback is formed in the main function. However, I've seen many examples where mdl_U is put ahead of mdlOuput(), like:
/* scheduling 2*/
main()
{
...
for (i=0;i<100;i++)
{
mdl_U = 1-mdl_Y; /* updating input using output */
mdlOutput();
mdlUpdate();
}
...
}
Above two schedulings give different results. I'm wondering which one is correct? Many thanks for any help.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by