How to implement dynamic Objects in Simulink?
4 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
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.
0 Comments
See Also
Categories
Find more on Discrete-Event Simulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!