0

Im quite new with matlab and im trying to use the containers.Map, for that there is a need to import that container.

when I use the command map = containers.Map(someKey, someValue);, I get this error undefined variable "containers" or class "containers.Map"

so I tried import containers.* but I get the same error.

matlab looks for the container on matlab workspace.

I also read this article and used java.util.HashMap, but after I type java. I got no completions found.

so I guess my question is- how can I import and use the map container properly?

If there is some other data structure (of- key, value) in matlab, its also acceptable.

I will be happy for some guidance, thanks.

Community
  • 1
  • 1
user1673206
  • 1,671
  • 1
  • 23
  • 43
  • Please provide a *reproducible* example along with the full error message and stack trace – sco1 Jan 20 '16 at 12:47

1 Answers1

0

The correct name is containers.Map, see Map Containers. Example:

>> map = containers.Map('Feb', 1000)

map = 

  Map with properties:

        Count: 1
      KeyType: char
    ValueType: double
Jørgen
  • 853
  • 9
  • 16