Matlab 错误保存 containers.Map()

Matlab error saving containers.Map()

我尝试将地图另存为 *.mat 文件,该文件非常大。 (大约 4 或 5gigs。我不能确定,因为我永远无法保存文件...)

地图生成者:

[amap, ~] = load_audio(config);

后来被

保存
save('audioMap', 'amap');

现在生成的文件只有218字节,没有出现错误。尝试读取包含 whos('-file', 'audioMap.mat') 的文件内容会导致以下错误:

Warning: Unable to read some of the variables due to unknown MAT-file error.

地图的每条记录都是一个包含 6 个值的单元格。现在在 Matlab 工作区中查询地图的大小会产生以下输出:

Name         Size            Bytes  Class             Attributes
amap      2279x1               112  containers.Map

现在很明显大小不正确,但我可以遍历地图并且所有数据都存在。当查询一条记录的大小时,它大约是 2.5MB。

我还尝试通过右键单击并另存为来保存工作区中的变量,结果相同。 有人知道为什么 Matlab 无法正确保存这张地图吗?

您正在尝试编写 has a maximum variable size of 2^31 bytes=2GB

的 MAT 文件版本 7.0

当您尝试写入大于限制的变量时,预期的行为是在保存变量时 receive a warning

Warning: Variable 'varname' cannot be saved to a MAT-file whose version is older than 7.3. To save this variable, use the -v7.3 switch. Skipping...

出于某种原因,没有发出警告,但无法写入如此大的对象是预期的行为。