Help for data in txt file

1 次查看(过去 30 天)
Hy all, i have a txt file in which i stock some integers in brute manner, i need to create a copy of this file but i stock my integer in decrase order with no repitition, forme example: A.txt
2
3
3
1
B.txt
1
2
3
Please healpe my

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-3-24
编辑:Azzi Abdelmalek 2016-3-24
use unique function
b=[2;3;3;1]
a=unique(b)
  3 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2016-3-26
yes, but if you want to use unique function without sorting
c=unique(b,'stable')
Stephen23
Stephen23 2016-3-26
编辑:Stephen23 2016-3-26
@Ferial Assmani: The output of unique is sorted by default, as the documentation clearly states.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by