a serialized simulation in Simulink
조회 수: 1 (최근 30일)
이전 댓글 표시
I am going to get some values from Simulink and return them back to Simulink with some changes. What I need is a serialized simulation where the output of the first simulation is sent to the second simulation. The result of the second simulation is important to me. How can I run this serialized simulation in Simulink?
댓글 수: 2
Fangjun Jiang
2023년 1월 13일
편집: Fangjun Jiang
2023년 1월 13일
For a Simulink simulation, there is a Simulink model. You provide some input data, run the simulation and get some output data.
When you talk about first and second simulation, are you talking about running the simulation twice with the same model? or something else, like the output of one model is sent to the second model?
If it is running simulation twice, it sounds like you want the output data of the first simulation to be used as the input data for the second simulation. Then what and how do you provide the input data for the first simulaton?
답변 (1개)
Fangjun Jiang
2023년 1월 15일
This should be a relatively easy task. I think the best way is to implement it in the "StopFcn" callback of the model.
Open the model, click file, properties, callbacks, and type in your script at the "StopFcn", which calculates and over-write the value of "t".
Make your processing a .m Script, not a .m Function, so you can access the base worspace variable directly.
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!