Does MATLAB have a way to create a dynamic Object storing array?

5 views (last 30 days)
I have a large number of a single type of Object, which has a few properties such as a unique ID. I need a way to store these objects in an array-like structure.
The problem is that in my script, these objects are constantly being deleted, and new Objects constantly being created.
I want a way to store my objects in such a way that they can be looked up with an integer ID, but I don't want to have to keep track of empty array spaces (which would come about if when Objects are deleted).
Basically, I'm looking for the equivalent of an ArrayList (google search may help). I've looked at containers.Map Objects, but they don't let me edit the Object Properties or call Object Methods directly from the container.
Does anyone know if such a thing exists in MATLAB?

Answers (0)

Categories

Find more on Construct and Work with Object Arrays 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!