Main Content

字典

使用对值进行索引的键映射数据

字典是一种将每个键与对应的值相关联的数据结构体。键和值可以采用任何数据类型,为数据访问提供优于数组索引的灵活性,并能提高性能。

推荐使用 dictionary 而不是 containers.Map,因为它支持更多数据类型作为键和值,并能提供更好的性能。 (自 R2022b 起)

函数

dictionary将唯一键映射到值的对象 (自 R2022b 起)
configureDictionaryCreate dictionary with specified key and value types (自 R2023b 起)
insertAdd entries to a dictionary (自 R2023b 起)
lookupFind value in dictionary by key (自 R2023b 起)
removeRemove dictionary entries (自 R2023b 起)
entriesKey-value pairs of dictionary (自 R2022b 起)
keys字典的键 (自 R2022b 起)
valuesValues of dictionary (自 R2022b 起)
typesTypes of dictionary keys and values (自 R2022b 起)
numEntriesNumber of key-value pairs in dictionary (自 R2022b 起)
isConfiguredDetermine if dictionary has types assigned to keys and values (自 R2022b 起)
isKeyDetermine if dictionary contains key (自 R2022b 起)
keyHashGenerate hash code for dictionary key (自 R2022b 起)
keyMatchDetermine if two dictionary keys are the same (自 R2022b 起)

全部展开

containers.Map将唯一键映射到值的对象

主题