Filter löschen
Filter löschen

Help for data in txt file

1 Ansicht (letzte 30 Tage)
Ferial Assmani
Ferial Assmani am 24 Mär. 2016
Bearbeitet: Stephen23 am 26 Mär. 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by