How to use Hash Tables (dictionaries) in MATLAB? [duplicate]

In recent versions of MATLAB, there’s the containers.Map data structure. See MATLAB Map containers for more. This removes some of the restrictions when using STRUCTs. For example

c = containers.Map
c('foo') = 1
c(' not a var name ') = 2
keys(c)
values(c)

Leave a Comment