Compiled Simulink model of transfer function block giving different results
이전 댓글 표시
I have a very simple model that consists of an input port, a transfer function and an output port. The model is attached to this question in case you want to check it.
The inputs for the first three steps are { -60.982112667828780, -60.781022873413790,60.168975966495110 }.
The outputs in Simulink are: {0, -0.003033557714140, -0.012065510055461}
While in the C code I get the following results: {0, 0, -0.0060982112667828780}.
I have read the answer to a simular question posted here: https://www.mathworks.com/matlabcentral/answers/90341-compiled-simulink-model-giving-different-results
So I unchecked the Single output/update function option in order to have them separated.
I don't know what is causing my results to be so different in Simulink and the generated C code. Does anybody have any idea?
댓글 수: 2
Birdman
2017년 12월 7일
One simple question: What is your sampling rate for discretizing your transfer function while generating C code?
RICARDO SEGALLA
2017년 12월 7일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!