octavemat-file

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?


Solution

  • 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:

    So there's 2 things you can do: