| Contents | Index |
Identify values in containers.Map object
valueSet = values(mapObj)
valueSet = values(mapObj,keySet)
valueSet = values(mapObj) returns all of the values in mapObj.
valueSet = values(mapObj,keySet) returns values that correspond to the specified keys.
mapObj |
Object of class containers.Map. |
keySet |
Cell array that specifies keys in mapObj. |
valueSet |
Cell array containing values from mapObj. If you specify keySet, the valueSet array has the same size and dimensions as keySet. |
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 array valueSet:
valueSet =
[1] [2] [3]View the values corresponding to keys a and c in mapObj, created in the previous example:
keySet = {'a','c'};
valueSet = values(mapObj,keySet)This code returns 1-by-2 cell array valueSet:
valueSet =
[1] [3]
containers.Map | isKey | keys
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |