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=22944)

poster 2019-12-10 16:49

如何在MATLAB中读取文件的末尾?
 
我有一个文件a.txt :

03,17.406199 05,14.580129 07,13.904058 11,14.685388 15,14.062603 20,14.364573 25,18.035175 30,21.681789 50,22.662820 文件中的行数未知。我想读取文件并存储

3 5 7 11 15 20 30 50 在一个数组中,浮点值在另一个数组中。

[B]当数据长度未知时,如何读取文件?[/B]


回答:
如果每一行的条目数都相同,并且所有条目都是数字,那么您只需 a = load('a.txt');

a将是具有两列的矩阵。



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


所有时间均为北京时间。现在的时间是 23:30

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