필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
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