필터 지우기
필터 지우기

Compact the values in a string

조회 수: 1 (최근 30일)
pamela sulis
pamela sulis 2016년 3월 18일
답변: the cyclist 2016년 3월 18일
Hi! I have a string '641 617 674 674 631 631 631 631 654 629 625 625 673 674': I want to delete duplicate. Ex
'641 617 674 674 631 631 631 631 654 629 625 625 673 674'
will became
'641 617 674 631 654 629 625 673 674'
can you help me?

채택된 답변

the cyclist
the cyclist 2016년 3월 18일
Here's one way:
s = '641 617 674 674 631 631 631 631 654 629 625 625 673 674';
unique_s = num2str(unique(str2num(s),'stable'))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by