Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Octave containers.Map() undefined

Tags:

octave

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?

like image 970
John Avatar asked Mar 07 '23 14:03

John


1 Answers

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
like image 143
Andy Avatar answered May 09 '23 23:05

Andy