Number of key-value pairs in Map object
Map
L = length(M)
example
L = length(M) returns the number of key-value pairs in the input Map object. length(M) is equivalent to size(M,1) and to the property M.Count.
M
length(M)
size(M,1)
M.Count
collapse all
Create a Map object.
months = {'Jan','Feb','Mar','Apr'}; rainfall = [327.2 368.2 197.6 178.4]; M = containers.Map(months,rainfall)
M = Map with properties: Count: 4 KeyType: char ValueType: double
Return the number of key-value pairs that it contains.
L = 4
Input Map object.
containers.Map | isKey | keys | size | values
containers.Map
isKey
keys
size
values
You have a modified version of this example. Do you want to open this example with your edits?