I am trying to read the following sequence of numbers from a textfile:
1323211
11
1163211
11
1512321112
14096321
2
1256321221024642
1
1
1256321221024642
10296844
4102782
3609910
0
492872
492840
61116
0
01201
01201
00149
00000
1989016
1982261
436984
6755
6739
6734
0
00034
00034
00034
00000
In order to do this I am using the method outlined here: http://www.mathworks.se/help/matlab/ref/fscanf.html#bt_j35z-2_1
I can verify the contents of the file with the type
command, but the reading goes wrong for some reason, giving this output:
>> fid = fopen('file.txt', 'r')
fid =
5
>> A = fscanf(fid, '%f')
A =
1.0e+15 *
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
1.2563
0.0000
0.0000
1.2563
0.0000
0.0000
0.0000
0
0.0000
0.0000
0.0000
0
0.0000
0.0000
0.0000
0
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0
0.0000
0.0000
0.0000
0
I use %f
in the example, but %d
returns an empty vector.
csvread
, dlmread
and textscan
all yield the same result. What causes this?