I need to use containers.Map()
to convert some MATLAB code to Octave. I see in the GNU Octave bug tracker #49559 that containers.Map()
has been implemented, but I am still getting error: 'containers' undefined
when I try to use it. Is this functionality available in the current release builds, and if so how should I access it?
Asked
Active
Viewed 1,280 times
4

John
- 791
- 1
- 6
- 22
-
Could you please provide a code example on what exactly you are trying to do? – Georg W. Nov 15 '17 at 19:48
-
I don't think `containers.Map()` has been pushed to the release version, so you'll have to either build from the development source or wait for a new release. [This answer](https://stackoverflow.com/questions/11622084/converting-matlab-to-octave-is-there-a-containers-map-equivalent) may be useful in the meantime. – sco1 Nov 15 '17 at 20:04
-
Thanks @excaza. This isn't time critical so I will monitor releases to see when it becomes available. – John Nov 15 '17 at 20:29
1 Answers
7
Since the new functionality is written as .m file you can just download the file and insert it into your existing 4.2.x installation.
You are not mentioning if you are using GNU Octave on GNU/Linux or windoze so I assume GNU/Linux here:
- create a directory "+containers" in Octaves "m" folder (you have to use sudo if it's a global install)
- wget http://hg.savannah.gnu.org/hgweb/octave/raw-file/b04466113212/scripts/%2Bcontainers/Map.m
voilá, Map in OCtave 4.2.1:
octave:1> ver
GNU Octave Version: 4.2.1
...
octave:2> containers.Map
ans =
containers.Map object with properties:
Count : 0
KeyType : char
ValueType : any

Andy
- 7,931
- 4
- 25
- 45