Combining two C++ generated codes from 2 Simulink model
조회 수: 2 (최근 30일)
이전 댓글 표시
I have 2 Simulink models, one is a spring-mass-damper system:
and one is a PI controller
with parameters: m = 1;c = 10;k = 50;Kp = 30;Ki = 70; reference = 0.2; After generating C++ codes using Simulink Coder for these 2 models, I tried to include both C++ files in one main class which simply run C++ code of the controller first and then the plant model. The results are quite different with the Simulink even though it converses to 0.2 eventually. I tried to connect them both in Simulink and then generate 1 C++ file, then run this file but the result is also different from Simulink file and from the combination of 2 generated codes. Could anyone give me a suggestion on how this happens? Thank you very much in advance!
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!