How to implement dynamic Objects in Simulink?

조회 수: 4 (최근 30일)
Sven Mertin
Sven Mertin 2015년 9월 11일
답변: Sven Mertin 2015년 11월 16일
Hey everyone, I'm new to this forum and have a question about a genereal development problem.
I want to to test distributed control algorithms for vehicles and therefore I have created a simulink model. Now the problem is, that I need to generate vehicles (very simple model) for my simulation at a specific rate of entry at multiple inputs. For one vehicle I just need to save the entry time, the speed and the direction to leave. So there will allways be a dynamic number of vehicles within my model. How can I include such a data structure in simulink? I tried the object oriented programming provided by Matlab, since this is the way I would normally implement the problem in a normal higher programming language. But I foccussed several problems, I think Simulink can't handle my self defined data types (the classes). I also thought about creating interfaces to an external application and implement the OO-problem in an C++ application. But I couldn't figure out how to do this properly.
Does anyone have an idea, how to implement this in Simulink?
Thanks in advanced Sven Henning

답변 (2개)

Joachim Schlosser
Joachim Schlosser 2015년 11월 10일
You want to simulate the environment/infrastructure for your algorithm? In this case you may want to try out SimEvents for this purpose. It has the ability to create entities at stochastic rates, and allows to influence their properties with Simulink and Stateflo as well as MATLAB algorithms.

Sven Mertin
Sven Mertin 2015년 11월 16일
Hi Joachim, thank you for your answer! I will take a look on the suggested SimEvents.
Regards Sven

카테고리

Help CenterFile Exchange에서 Discrete-Event Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by