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!