How can I delete repeated elements? (not unique!)
조회 수: 1 (최근 30일)
이전 댓글 표시
채택된 답변
추가 답변 (2개)
Joakim Magnusson
2014년 8월 13일
I don't know such a function, but try this:
Output = Input;
0 = 1;
while i < size(Output,2)
if Output(i) == Output(i+1)
Output(i+1) = [];
else
i = i+1;
end
end
댓글 수: 0
Andrei Bobrov
2014년 8월 13일
편집: Andrei Bobrov
2014년 8월 13일
Output = Input([true,diff(Input)~=0])
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!