フィルターのクリア

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 Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by