4

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?

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 Answers1

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:

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