How to implement dynamic Objects in Simulink?

5 vues (au cours des 30 derniers jours)
Sven Mertin
Sven Mertin le 11 Sep 2015
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

Réponses (2)

Joachim Schlosser
Joachim Schlosser le 10 Nov 2015
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 le 16 Nov 2015
Hi Joachim, thank you for your answer! I will take a look on the suggested SimEvents.
Regards Sven

Catégories

En savoir plus sur Discrete-Event Simulation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by