erasing the second duplicate date
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
Dear all,
I have
A={
 '12/08'
    '01/09'
    '02/09'
    '03/09'
    '03/09'
    '04/09'
    '05/09'
    '06/09'
    '07/09'
    '08/09'
    '09/09'
    '10/09'
    '11/09'
    '12/09'
    '01/10'
    '01/10'
    '02/10'
    '03/10'
    '04/10'
    '05/10'
    '06/10'
    '07/10'
    '08/10'
    '09/10'
    '10/10'
    '11/10'
    '12/10'
    '01/11'
    '01/11'
    '02/11'
    '03/11'
    '04/11'
    '05/11'
    '06/11'
    '07/11'
    '08/11'
    '09/11'
    '10/11'
    '11/11'}
I want to erase from the succesive identical months the second one.
For instance I have
 '01/10'
    '01/10'
I want to erase the second duplicate without using a loop if possible because my vector is huge so at to have
A= {
 '12/08'
    '01/09'
    '02/09'
    '03/09'
    '03/09'
    '04/09'
    '05/09'
    '06/09'
    '07/09'
    '08/09'
    '09/09'
    '10/09'
    '11/09'
    '12/09'
    '01/10'
    '02/10'
    '03/10'
    '04/10'
    '05/10'
    '06/10'
    '07/10'
    '08/10'
    '09/10'
    '10/10'
    '11/10'
    '12/10'
    '01/11'
    '02/11'
    '03/11'
    '04/11'
    '05/11'
    '06/11'
    '07/11'
    '08/11'
    '09/11'
    '10/11'
    '11/11'}
I want to erase from the succesive identical months the second one.
thanks
댓글 수: 0
채택된 답변
  Azzi Abdelmalek
      
      
 2012년 8월 2일
        
      편집: Azzi Abdelmalek
      
      
 2012년 8월 2일
  
       unique(a)    % this will sort the result
% if you want to have the same order use this:
 unique(a,'stable')
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

