Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

Map Containers

Objects with keys that index to values, where keys need not be integers

Functions

containers.Map Map values to unique keys
isKey Determine if containers.Map object contains key
keys Identify keys of containers.Map object
remove Remove key-value pairs from containers.Map object
values Identify values in containers.Map object

Topics

Overview of the Map Data Structure

A Map is a type of fast key lookup data structure that offers a flexible means of indexing into its individual elements. The indices for a Map can be nearly any scalar numeric value or a character vector.

Description of the Map Class

A Map is an object, or instance, of the containers.Map class.

Creating a Map Object

Create a Map using the containers.Map class.

Examining the Contents of the Map

This example shows how to find all the keys and values in a Map.

Reading and Writing Using a Key Index

This example shows how to read from a Map structure and how to add new key/value pairs.

Modifying Keys and Values in the Map

This example shows how to remove and modify keys and values in a Map structure.

Mapping to Different Value Types

This example shows how to store structures or cell arrays in a Map structure.

Was this topic helpful?