作者lavendin82 (将将将将)
看板MATLAB
标题[问题]只读取txt档中的数据成矩阵
时间Thu Dec 15 19:29:46 2011
各位大大们好,小弟现在有一个txt档如下
档名:example.txt
内容:
max,min
PERFORM DRIFT TIME HISTORIES
Structure = Strcture 1
Analysis Series = PEER 2-1 IDA
Load Case =, [3] = [2] + PEER 2-1 Sa = 0.1g
Column 1 =, time (sec)
Column, 2, = drift no., 6, name =, 1st
Column, 3, = drift no., 7, name =, 2nd
Column, 4, = drift no., 8, name =, 3rd
Column, 5, = drift no., 9, name =, 4th
Maximum,0.0014368,0.0017769,0.0015642,0.0017663
Minimum,-0.001507,-0.001819,-0.0021522,-0.001507
我要的是最後两行的数字然後转成矩阵
0.0014368 0.0017769 0.0015642 0.0017663
-0.001507 -0.001819 -0.0021522 -0.001507
这样的矩阵而已!不好意思有点赶,爬文了一些也看不太懂^^"
拜托了!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.13.114
1F:推 hugebird:我的作法是 用fgetl逐行读到最後两行 再取出你需要的数字 12/15 20:34
2F:→ hugebird:记得读完要把字串转成数值 12/15 20:35