In one of my recent coding projects, I needed a map data structure, i.e., something that would store key/value pairs - similar to a dictionary in Python. I’d been planning to write something up myself (hacked together), but a little bit of searching turned up:
m = containers.Map;
which was just what I needed. This is a hashmap implementation, which was (apparently) introduced in R2008b. Adding new key/value pairs is straightforward:
m('Jim') = 'Brother';
for example. There’s lots more - check it out by typing
at the MATLAB command prompt.
- Add a comment // // Add to...