Why doesn't Octave's 'save' function support single precision for MAT-files
题
I have Octave 3.2-4 on Ubuntu 11.10. This is the officially supported version for Ubuntu. Where it seems that GNU Octave's save
function does not support binary data saving in single precision float format in MAT-files. For instance:
octave:119> p_t = single(rand(1,5))
p_t =
0.038507 0.117961 0.894508 0.788297 0.651727
octave:120> class(p_t)
ans = single
octave:121> save -v6 P_T.mat p_t
octave:122> clear all
octave:123> load -v6 P_T.mat p_t
octave:124> p_t
p_t =
0.038507 0.117961 0.894508 0.788297 0.651727
octave:125> class(p_t)
ans = double
I have tried searching for a known issue of Octave, but could not find anything... Anyone else noticed this problem?
解决方案
Upgrade. That has already been fixed.
"officially supported version for Ubuntu"? That means absolutely nothing. And even if you mean "latest version packaged by Ubuntu", it would be false. Anyway:
- you are using an old Ubuntu version. The latest Ubuntu already has Octave 3.6.2
- you are using an old Octave version (almost 3 years old. There's been 7 releases of Octave since, including 2 major releases)
So there's 2 things you can do:
- update your Ubuntu for 12.10
- update your Octave version, either compiling from source or using a PPA
不隶属于 StackOverflow