Does MATLAB have a data structure to which elements can be added and removed without copying all of data?
AFAIK it lacks a list (like in Python), so I'm trying to implement it, but unsure what to build it on. I figured cell array, but the linter suggests it's actually an array. One could implement it the long way where each element is a separate class, using handle
classes as containers as pointers, but I'm guessing that's not efficient in MATLAB.
struct
? Extend a cell array each time its length is exceeded? More important than not copying the list is to not copy its contents, namely arrays.
Edit: I implemented Pythonic list
and dict
based on cellarray
and containers.Map
, here.