Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Creating new model or block instances during run-time...

조회 수: 2 (최근 30일)
Kevin Noll
Kevin Noll 2013년 3월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
I am creating a model of a packet network (SimEvent and StateFlow) in which I have multiple transmitters and receivers. All transmitters are controlled by a single scheduler.
I would like to add new transmitters to the network during execution (e.g. click a button to add/remove transmitters).
Similarly, the scheduler needs to implement a poller for each transmitter instance. The poller is currently implemented in StateFlow.
Is there a way to create a model or block (the transmitter) and have new instances of it generated during run-time? If so, how?
Likewise, how would I instantiate a new poller instance when a new transmitter is created?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 12일
편집: Azzi Abdelmalek 2013년 3월 12일
What you can do, is pause simulation, add a block then continue simulation using
set_param('yourmodel','SimulationCommand','pause')
Then use add_block, and add_line command to add block and connections. Then add
set_param('yourmodel','SimulationCommand','continue')
Remark, I did not check this solution

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by