| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
v = values(M)
v = values(M, keys)
v = values(M) returns in cell array v the values that correspond to all keys in Map object M.
v = values(M, keys) returns in cell array v, those values in Map object M that correspond to the keys specified by the keys argument.
Read more about Map Containers in the MATLAB Programming Fundamentals documentation.
Create a Map object of four US states and their capital cities:
US_Capitals = containers.Map( ...
{'Georgia', 'Alaska', 'Vermont', 'Oregon'}, ...
{'Atlanta', 'Juneau', 'Montpelier', 'Salem'})
Find the capital cities of all states contained in the map:
v = values(US_Capitals)
v =
'Juneau' 'Atlanta' 'Salem' 'Montpelier'Find the capital cities of selected states:
= values(US_Capitals, {'Oregon', 'Alaska'})
v =
'Salem' 'Juneau'containers.Map, keys(Map), size(Map), length(Map), isKey(Map), remove(Map), handle
![]() | validatestring | vander | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |