Help CenterHelp Center
Number of key-value pairs inMapobject
Map
L = length(M)
example
L = length(M)returns the number of key-value pairs in the inputMapobject.length(M)相当于size(M,1)and to the propertyM.Count.
M
length(M)
size(M,1)
M.Count
collapse all
Create aMapobject.
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
InputMapobject.
containers.Map|isKey|keys|size|values
containers.Map
isKey
keys
size
values
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office