What is the easiest way to extract the data from this string with matlab?
I have a text-file which contains data formatted like this:
000000:11.315 2049.000000
000000:11.320 2050.000000
000000:11.327 2048.000000
000000:11.333 2050.000000
000000:11.338 2049.0开发者_如何学JAVA00000
000000:11.348 2048.000000
How can I extract the data into three arrays? I've played around with textscan
, but I was not able to figure out a proper format-string that worked. (The number of lines is of course not 6, but arbitrary.)
fid = fopen('dat.txt');
scannedData = textscan(fid, '%f:%f %f', 'CollectOutput', true)
fclose(fid);
精彩评论