What is the essential difference between matlab's new built-in data type dictionary and the old containers.Map?

34 views (last 30 days)
matlab has introduced a new data type dictionary since R2022b, which is very good. But as far as I know, since R2008b, there are actually similar types of containers.Map, and most of their member functions support the same operations, so I'm curious what the essential differences are? And then what is the recommended context for using each?

Accepted Answer

Steven Lord
Steven Lord on 18 Oct 2022
The Release Notes state as one benefit "In almost all use cases, dictionary performs faster than containers.Map."
You may also want to follow the blog named "The MATLAB Blog". At the end of this blog post @Mike Croucher said "In the next two posts I'll take a deep dive into the different types you can use in dictionaries, including user-defined classes and will also compare the new functionality with the venerable containers.map."

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!