0$房天下问答|matlab怎么删除txt文本中重复的数据?$https://m.fang.com/ask/ask_1662921.html$https://static.soufunimg.com/common_m/m_public/201511/images/asksharedefault.png
packc/pages/ask/detail/detail?askid=1662921
共1个回答
-
-
-
马凌云
丨Lv 1
主要是用unique命令,你说的删除重复数据,我估计是删除重复行。fp=fopen('data.txt','r');tem1=fscanf(fp,'%f');fclose(fp)tem1=reshape(tem1,5,length(tem1)/5)';[tem2,I,J]=unique(tem1,'rows');tem4=tem1(I,:)结果是:tem4 = 6.0000 5.8000 2.5000 -1.8000 -1.9000 7.0000 4.1000 4.1000 -0.8000 1.6000 8.0000 2.8000 2.3000 2.2000 -0.5000 9.0000 -1.5000 -1.9000 1.1000 0.9000 10.0000 0.9000 0.2000 0 0.1000 11.0000 2.3000 -3.6000 0.7000 -0.6000 12.0000 -1.2000 -0.4000 -0.2000 -0.1000 13.0000 -4.4000 0.3000 -0.3000 -0.2000 14.0000 -0.9000 0.9000 -0.4000 -0.4000 15.0000 0.8000 1.6000 0 -0.3000 16.0000 2.4000 -0.2000 0.1000 -0.1000 17.0000 2.6000 -0.6000 0.2000 0.2000 18.0000 4.6000 1.0000 0.3000 0.1000 19.0000 2.3000 1.4000 0.9000 0.2000 20.0000 2.4000 0.9000 0.5000 0.4000
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。

关注成功