I want to run two or more simulink model in parallel and synchronisation.

徘徊边缘 提交于 2019-12-11 18:08:14

问题


Hi I want to run two or more simulink model in parallel and synchronisation. is there any way to do it? One way I think is by creating a subsystem and put all models inside it. It should run parallely. This one is not prefered for me. I want to open two matlab instances and run two different model in synchronisation. is this possible? I want to do it programmatically. Any help is appreciable.


回答1:


You should use a matlab script and implement the synchronization logic in it.

== Update ==

You can execute the simulink model by simply calling it from a Matlab Script. You have to define a task containing the next steps: First you can calculate inputs in Matlab. Then execute the first model with the first inputs. Then save the results to a certain variable. Finally use that variable on the second model and launch second model simulation.

Repeat the task for all the necessary steps.




回答2:


If you have the Instrument Control Toolbox, you can send/receive data between the two models via TCP/IP or UDP/IP blocks. No need to have two MATLAB sessions, this can be done from one MATLAB session, see this loopback example.

However, I would query the need to have two separate models. Why not put both models in the same model as subsystems, or even as Model blocks if you want to keep the atomic nature of each sub-model?



来源:https://stackoverflow.com/questions/31288319/i-want-to-run-two-or-more-simulink-model-in-parallel-and-synchronisation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!