dictionary

Methods

Method Reference: dictionary.numEntries

dictionary: n = numEntries (d)

Return the number of entries.

n = numEntries (d) returns the number of entries in d as a double, 0 for an unconfigured dictionary.

See also: dictionary.numel

Source Code: dictionary

numEntries counts the entries, where numel is always 1.

 d = dictionary (hours ([1, 2, 6]), {'short', 'medium', 'long'})
d =

  dictionary (duration ⟼ cell) with 3 entries:

    1 hr ⟼ {'short'}
    2 hr ⟼ {'medium'}
    6 hr ⟼ {'long'}
 numEntries (d)
ans = 3
 d(hours (2)) = [];
 numEntries (d)
ans = 2