MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   使用matlab从此字符串中提取数据的最简单方法是什么? (https://www.labfans.com/bbs/showthread.php?t=24191)

poster 2019-12-10 20:48

使用matlab从此字符串中提取数据的最简单方法是什么?
 
我有一个文本文件,其中包含如下格式的数据:

000000:11.315 2049.000000 000000:11.320 2050.000000 000000:11.327 2048.000000 000000:11.333 2050.000000 000000:11.338 2049.000000 000000:11.348 2048.000000 如何将数据提取到三个数组中?我玩过textscan ,但是我无法找出合适的格式字符串。 (行数当然不是6,而是任意的。)



[B]回答:[/B]

fid = fopen('dat.txt'); scannedData = textscan(fid, '%f:%f %f', 'CollectOutput', true) fclose(fid);

[url=https://stackoverflow.com/questions/4364826]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 09:07

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.