首页 > 数据库 > 数据库开发技术 > matlab环境下怎么样从txt文件中读取数据
文件内容形式一(假定文件名为test1.txt):
你好
欢迎来到
动力学与控制技术论坛
www.dytrol.com
1 11 111 1111
2 22 222 2222
3 33 333 3333
4 44 444 4444
5 55 555 5555
这样的文件怎么读入数据呢?
方法有多种,现举两个比较简单实用的。
方法一:
file/import data....../next/finish
>> whos
Name Size Bytes Class
data 5x4 160 double array
textdata 4x1 300 cell array
Grand total is 54 elements using 460 bytes
>> data
data =
1 11 111 1111
2 22 222 2222
3 33 333 3333
4 44 444 4444
5 55 555 5555
>> textdata
textdata =
'你好'
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9157419/viewspace-925143/ ,如需转载,请注明出处,否则将追究法律责任。