why is dictionary introduced so later in matlab?
Show older comments
I have been using matlab since 2006, but I have never heard of the dictionary structure untile recently when I started learning python.
After some check, I found that the dictionary structure was introduced into matlab only since 2022b.
That is amazingly later.
Why? Is the dictionary structure in conflict with the inner mechanism of matlab?
4 Comments
Bruno Luong
on 7 Apr 2024
Moved: Bruno Luong
on 9 Apr 2024
There is an earlier key hash implementation called containers.Map however it is not as well design and the engine is quite slow which kind of defeat the usage.
John D'Errico
on 7 Apr 2024
Surely you don't expect that every possible feature in MATLAB would have been introduced when the language was first written? containers,Map was introduced in R2008b. In fact, not long after you started using MATLAB. I would imagine it seemed adequate for the purpose at the time, and for many years after. Eventually someone decided they knew of a better implementation of the idea, so dictionary was introduced. But you need to consider the person who would have pushed for it would need to show they could do better then the containers tool, and that it would be a worthwhile investment of company resources.
min lee
on 8 Apr 2024
Bruno Luong
on 8 Apr 2024
Edited: Bruno Luong
on 8 Apr 2024
"My concern is, the late implementation might suggest that intrinsically matlab is not very compatible with this kind of data structure"
I don't see why the data structure have anything to do with key hasing algorithm (as implemented by dictionary). Note that MATLAB has oop (class) for vey long.
Even if it was the case, you would not get an official answer, TMW staffs never discuss internal data structure related topic in public.
Answers (0)
Categories
Find more on Document and Integrate Toolboxes 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!