Borrar filtros
Borrar filtros

Help for data in txt file

1 visualización (últimos 30 días)
Ferial Assmani
Ferial Assmani el 24 de Mzo. de 2016
Editada: Stephen23 el 26 de Mzo. de 2016
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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by