简体   繁体   English

倍频程:“加载:无法加载矩阵常数”

[英]Octave: “load: failed to load matrix constant”

I would like to save and load a set of images in Octave / Matlab. 我想在Octave / Matlab中保存和加载一组图像。 The general instructions given in the FAQ do not seem to work with saving and loading (octave 3.2.4, Ubuntu 12.04). 常见问题解答中给出的一般说明似乎不适用于保存和加载(八度3.2.4,Ubuntu 12.04)。

Namely, using bg_header_mwlogo_notag.jpg 即,使用bg_header_mwlogo_notag.jpg

images = cell(1, 1);
for i=1
    images{i} = imread('/tmp/bg_header_mwlogo_notag.jpg');
end
save images;
load images;

gives: 给出:

error: load: failed to load matrix constant
error: load: trouble reading ascii file `'
error: load: reading file 
error: load: cell array element had unexpected name
error: load: failed to load cell element
error: load: trouble reading ascii file `images'
error: load: reading file images

How can I save and load several images to and from one file? 如何在一个文件中保存和加载多个图像?

There is some problem loading the ASCII representation of the matrix from file. 从文件加载矩阵的ASCII表示存在一些问题。 If you rather issue 如果你宁愿发出

images{i} = double(imread('/tmp/bg_header_mwlogo_notag.jpg'));

it actually stores the numeric values instead, which is perfectly fine for Matlab. 它实际上存储的是数字值,这对于Matlab来说是完美的选择。 You can easily check that the two representations are equal. 您可以轻松地检查两个表示形式是否相等。 On the other hand, loading such numeric version of the matrix from file succeeds. 另一方面,成功从文件加载矩阵的这种数字版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM