开发者

What is the easiest way to extract the data from this string with matlab?

开发者 https://www.devze.com 2023-01-28 08:25 出处:网络
I have a text-file which contains data formatted like this: 000000:11.315 2049.000000 000000:11.320 2050.000000

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消