MATLAB Answers

How to implement dynamic Objects in Simulink?

6 views (last 30 days)
Sven Mertin
Sven Mertin on 11 Sep 2015
Answered: Sven Mertin on 16 Nov 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

Answers (2)

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

Community Treasure Hunt

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

Start Hunting!