八度 containers.Map() 未定义

Octave containers.Map() undefined

我需要使用 containers.Map() 将一些 MATLAB 代码转换为 Octave。我在 GNU Octave bug tracker #49559 中看到 containers.Map() 已经实现,但是当我尝试使用它时我仍然得到 error: 'containers' undefined。此功能在当前版本中可用吗?如果可用,我应该如何访问它?

由于编写了新功能as .m file,您只需下载文件并将其插入现有的 4.2.x 安装。

你没有提到你是在 GNU/Linux 还是 windoze 上使用 GNU Octave,所以我假设这里是 GNU/Linux:

瞧,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