remove the repeating values in array
조회 수: 2 (최근 30일)
이전 댓글 표시
i have an array with 2 rows 9 columns values
29 29 29 29 25 25 29 29 27
13 13 13 13 14 14 13 13 19
i wanted to remove the repeating values and get the output as
29 25 27
13 14 19
what code should i write to remove the repeated values?? please do reply....
댓글 수: 0
채택된 답변
Andrei Bobrov
2013년 11월 28일
편집: Andrei Bobrov
2013년 11월 28일
a = [ 29 29 29 29 25 25 29 29 27;
13 13 13 13 14 14 13 13 19];
[ii,ii] = unique(a','rows','first')
out = a(:,sort(ii));
댓글 수: 2
추가 답변 (1개)
Azzi Abdelmalek
2013년 11월 28일
a=[29 29 29 29 25 25 29 29 27;
13 13 13 13 14 14 13 13 19];
b=a'
[ii,jj]=unique(a','rows')
out=b(sort(jj),:)'
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!