using unique function on column 2 and keep first col
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi sorry for this simple question
G =
1 2
1 3
1 5
5 10
6 10
8 13
9 13
10 13
12 13
13 14
unique(G(:,2));
result :
ans =
2
3
5
10
13
14
i want it to bring the first column with it like this and save it in same array or another new array
G =
1 2
1 3
1 5
5 10
8 13
13 14
Thanks
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2012년 12월 14일
편집: Azzi Abdelmalek
2012년 12월 14일
[c,idx]=unique(G(:,2)
out=G(idx,:)
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!