matlab中处理数据,怎么才能把英文字母 info去掉
1个回答
展开全部
将文本复制到txt文本中,注意每一行的格式要相同,将所有的,和,换成空格键,用全部替换就可以做到,假设以data命名,保存在E盘上,
输入以下程序:
[str1 str2 str3]=textread('E:\data.txt','%*s%*s%f%*s%f%*s%*s%*s%*s%f%*s%*s%*s%*s%*s')
'E:\data.txt'根据自己存放data.txt更改路径,
这样第3,5,10列数据就分别保存在str1,str2,str3里面了
如果想要显示长数据,在上面的程序前面加上
format long
>> [str1 str2 str3]
ans =
1.0e+004 *
0.303279095430000 1.142145948890000 0.005467200000000
0.303279095480000 1.142145948910000 0.005467200000000
0.303279095800000 1.142145948870000 0.005467800000000
0.303279095720000 1.142145948910000 0.005467300000000
0.303279095560000 1.142145948840000 0.005467300000000
0.303279095330000 1.142145948880000 0.005467200000000
0.303279095560000 1.142145948880000 0.005467000000000
0.303279095400000 1.142145948830000 0.005467200000000
0.303279095380000 1.142145948890000 0.005467500000000
0.303279095430000 1.142145948890000 0.005467200000000
0.303279095280000 1.142145948820000 0.005467300000000
0.303279095600000 1.142145948780000 0.005467100000000
0.303279095590000 1.142145948900000 0.005467300000000
0.303279095510000 1.142145948760000 0.005467200000000
0.303279095430000 1.142145948790000 0.005467300000000
0.303279095780000 1.142145948900000 0.005467400000000
0.303279095770000 1.142145948920000 0.005467400000000
提问者评价
大神给力撒~~
输入以下程序:
[str1 str2 str3]=textread('E:\data.txt','%*s%*s%f%*s%f%*s%*s%*s%*s%f%*s%*s%*s%*s%*s')
'E:\data.txt'根据自己存放data.txt更改路径,
这样第3,5,10列数据就分别保存在str1,str2,str3里面了
如果想要显示长数据,在上面的程序前面加上
format long
>> [str1 str2 str3]
ans =
1.0e+004 *
0.303279095430000 1.142145948890000 0.005467200000000
0.303279095480000 1.142145948910000 0.005467200000000
0.303279095800000 1.142145948870000 0.005467800000000
0.303279095720000 1.142145948910000 0.005467300000000
0.303279095560000 1.142145948840000 0.005467300000000
0.303279095330000 1.142145948880000 0.005467200000000
0.303279095560000 1.142145948880000 0.005467000000000
0.303279095400000 1.142145948830000 0.005467200000000
0.303279095380000 1.142145948890000 0.005467500000000
0.303279095430000 1.142145948890000 0.005467200000000
0.303279095280000 1.142145948820000 0.005467300000000
0.303279095600000 1.142145948780000 0.005467100000000
0.303279095590000 1.142145948900000 0.005467300000000
0.303279095510000 1.142145948760000 0.005467200000000
0.303279095430000 1.142145948790000 0.005467300000000
0.303279095780000 1.142145948900000 0.005467400000000
0.303279095770000 1.142145948920000 0.005467400000000
提问者评价
大神给力撒~~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询