re-delimiting data

Peng Du eddy.pdu at gmail.com
Thu Jun 16 18:18:15 CEST 2011


Hi everyone,

I collected some raw data which looks like:

-112 -100 -95 -91 -114 -112 -95 -90 -112 -112 -113 -107 -100 -109 -111 -106
-70 -98 -95 -111 -114 -114 -113 -111 -113 -103 -112 -109 -111 -112 -114 -112
...

-64 -57 -57 -112 -110 -93 -84 -86 -105 -98 -107 -99 -94 -113 -113 -115
-64 -55 -88 -113 -82 -83 -85 -88 -100 -114 -113 -99 -91 -109 -113 -110

So there are 16 columns per line.

I wrote a c++ program to do some calculation on the raw data and
reproduce a file with similar format which looks like:

-112 -100 -95 -91 -114 -112 -95 -90 -112 -112 -113 -107 -100 -109 -111 -106
-91 -99 -95 -101 -114 -113 -104 -100 -112 -108 -112 -108 -106 -110 -112 -109
-91 -97.3 -98.7 -105 -113 -113 -107 -96.7 -112 -109 -109 -102 -102
-111 -111 -109

Then I tried to read the file in Scilab using:

[num_read, val(1), val(2), val(3), val(4), val(5), val(6), val(7),
val(8),val(9), val(10), val(11), val(12), val(13), val(14), val(15),
val(16)] = mfscanf(fid, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d
%d");

However the raw data work ok, but with the process data file Scilab
always reports "invalid index error". Why this is happening?

Thanks very much.

Regards,

Peng



More information about the users mailing list