I need to find out the amount of non-zero elements with Matlab hashmap/hash-tables, nnz
does not work with it. For example, nnz(hhh.values)
does not work. How can I check non-zero elements in Matlab's hashmap?
keys = {'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'};
values = {327.2, 368.2, 197.6, 178.4, 100.0, 69.9}
hhh = containers.Map(keys, values)
nnz(hhh.values)
returns
Undefined function 'nnz' for input arguments of type 'cell'.