homeboy 发表于 2006-10-24 18:08

提取数据

问一个问题:
50, 5000, 0.900000, 0.900000, 1, 28563.000000
50, 5000, 0.900000, 0.900000, 2, 26643.000000
50, 5000, 0.900000, 0.900000, 3, 24936.000000
50, 5000, 0.900000, 0.900000, 4, 28075.000000
50, 5000, 0.900000, 0.900000, 5, 27230.000000
50, 5000, 0.900000, 0.900000, 6, 25593.000000
50, 5000, 0.900000, 0.900000, 7, 29172.000000
50, 5000, 0.900000, 0.900000, 8, 26323.000000
50, 5000, 0.900000, 0.900000, 9, 29076.000000
50, 5000, 0.900000, 0.900000, 10, 25369.000000
50, 5000, 0.900000, 0.900000, 11, 27418.000000
50, 5000, 0.900000, 0.900000, 12, 25061.000000
50, 5000, 0.900000, 0.900000, 13, 25019.000000
50, 5000, 0.900000, 0.900000, 14, 29815.000000
50, 5000, 0.900000, 0.900000, 15, 28767.000000
50, 5000, 0.900000, 0.900000, 16, 25798.000000
50, 5000, 0.900000, 0.900000, 17, 27080.000000
50, 5000, 0.900000, 0.900000, 18, 29368.000000
50, 5000, 0.900000, 0.900000, 19, 27811.000000
50, 5000, 0.900000, 0.900000, 20, 23566.000000
50, 5000, 0.900000, 0.900000, 21, 26377.000000
50, 5000, 0.900000, 0.900000, 22, 28076.000000
50, 5000, 0.900000, 0.900000, 23, 26549.000000
50, 5000, 0.900000, 0.900000, 24, 26080.000000
50, 5000, 0.900000, 0.900000, 25, 27876.000000
50, 5000, 0.900000, 0.900000, 26, 27639.000000
50, 5000, 0.900000, 0.900000, 27, 28000.000000
50, 5000, 0.900000, 0.900000, 28, 29314.000000
50, 5000, 0.900000, 0.900000, 29, 25852.000000
50, 5000, 0.900000, 0.900000, 30, 27838.000000
50, 5000, 0.900000, 0.850000, 1, 22666.000000
50, 5000, 0.900000, 0.850000, 2, 27413.000000
50, 5000, 0.900000, 0.850000, 3, 28091.000000
50, 5000, 0.900000, 0.850000, 4, 27359.000000
50, 5000, 0.900000, 0.850000, 5, 27745.000000
50, 5000, 0.900000, 0.850000, 6, 26735.000000
50, 5000, 0.900000, 0.850000, 7, 32693.000000
50, 5000, 0.900000, 0.850000, 8, 25801.000000
50, 5000, 0.900000, 0.850000, 9, 25196.000000
50, 5000, 0.900000, 0.850000, 10, 25838.000000
50, 5000, 0.900000, 0.850000, 11, 26182.000000
50, 5000, 0.900000, 0.850000, 12, 26950.000000
50, 5000, 0.900000, 0.850000, 13, 26997.000000
50, 5000, 0.900000, 0.850000, 14, 26680.000000
50, 5000, 0.900000, 0.850000, 15, 24401.000000
50, 5000, 0.900000, 0.850000, 16, 27971.000000
50, 5000, 0.900000, 0.850000, 17, 24406.000000
50, 5000, 0.900000, 0.850000, 18, 31904.000000
50, 5000, 0.900000, 0.850000, 19, 23533.000000
50, 5000, 0.900000, 0.850000, 20, 24052.000000
50, 5000, 0.900000, 0.850000, 21, 28638.000000
50, 5000, 0.900000, 0.850000, 22, 26029.000000
50, 5000, 0.900000, 0.850000, 23, 29153.000000
50, 5000, 0.900000, 0.850000, 24, 26642.000000
50, 5000, 0.900000, 0.850000, 25, 26967.000000
50, 5000, 0.900000, 0.850000, 26, 28654.000000
50, 5000, 0.900000, 0.850000, 27, 25961.000000
50, 5000, 0.900000, 0.850000, 28, 27873.000000
50, 5000, 0.900000, 0.850000, 29, 28229.000000
50, 5000, 0.900000, 0.850000, 30, 23464.000000
有一连串这样的数据,请问怎样编程提取出最后一列的数据??

happy 发表于 2006-10-24 18:23

假设矩阵名为x
则x(:,6)即为最后一列数据

jimin 发表于 2006-10-24 18:23

1.将数据存为一个txt文件,如aaaa.txt,
2.file ->import data 导入数据,结果为一个60*6的数组aaaa
3.在命令窗口输入>> p=aaaa(:,6);
页: [1]
查看完整版本: 提取数据