Borrar filtros
Borrar filtros

Compact the values in a string

1 visualización (últimos 30 días)
pamela sulis
pamela sulis el 18 de Mzo. de 2016
Respondida: the cyclist el 18 de Mzo. de 2016
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?

Respuesta aceptada

the cyclist
the cyclist el 18 de Mzo. de 2016
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'))

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by