필터 지우기
필터 지우기

Help for data in txt file

조회 수: 1 (최근 30일)
Ferial Assmani
Ferial Assmani 2016년 3월 24일
편집: Stephen23 2016년 3월 26일
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