Mon 24 Sep 2012 04:32:50 PM UTC, comment #1:
I faced the same problem.
I have tried different sizes in a loop since the problem shows randomly depending on the recorded data:
while(1)
x = randn(200,1);
save test.mat x;
load test.mat;
end
I carried out some experiments with different number of rows and columns.
Here are my findings:
1) The problem only appears for data containing negative real (double) numbers.
2) This is not the number of columns nor the number of rows that counts but the total file size (actually the total file size depend on the size of each single recorded double that varies)
4) The problem arise above around 190 recorded doubles (e.g. x = randn(190,1) or x = randn(95,2)... etc.) and is more frequent as the number of recorded double increase.
5) For small files (e.g. 200 elements) any character (space or non significant zero) added to any part (including header) makes an unreadable file readable.
6) No easy solution appears for larger files.
I join here an example of an unreadable file generated from the above program loop:
# Created by Octave 3.6.1, Mon Sep 24 18:31:09 2012 Paris, Madrid (heure d’été) <unknown@jju-port>
# name: a
# type: matrix
# rows: 200
# columns: 1
-1.148522356490188
1.143155412031432
2.029113100175301
1.433470377473792
0.5881021062605867
[...]
(full file available in joints documents)
This file can be turn readable by adding any character:
1) # columns: 1 --> # columns: 01
2) # name: a --> # name: ab
3) -01.148522356490188
4) adding one space anywhere
I hope that helps!
Thorgal
(file #26622)
|