Syntax
valueSet = values(mapObj)
valueSet = values(mapObj,keySet)
Description
returns all of the values invalueSet
= values(mapObj
)mapObj
.
returns values that correspond to the specified keys.valueSet
= values(mapObj
,keySet
)
Input Arguments
|
Object of class |
|
Cell array that specifies keys in |
Output Arguments
|
Cell array containing values from |
Examples
Get All Values in a Map
Create a map, and view all values in the map:
myKeys = {'a','b','c'}; myValues = [1,2,3]; mapObj = containers.Map(myKeys,myValues); valueSet = values(mapObj)
This code returns 1-by-3 cell arrayvalueSet
:
valueSet = [1] [2] [3]
Get Selected Values in a Map
View the values corresponding to keysa
andc
inmapObj
, created in the previous example:
keySet = {'a','c'}; valueSet = values(mapObj,keySet)
This code returns 1-by-2 cell arrayvalueSet
:
valueSet = [1] [3]
See Also
Was this topic helpful?