Borrar filtros
Borrar filtros

[SIMPLE] How to make matlab find the difference of a set of strings in a 1 column matrix

2 visualizaciones (últimos 30 días)
hi
what i mean:
i have a matrix with string(it is a name);
T-NI-UA-kunde1-1
T-NI-UA-kunde1-1
T-NI-UA-kunde1-1
T-NI-UA-kunde1-2
T-NI-UA-kunde1-2
T-NI-UA-kunde1-2
T-NI-UA-kunde2-1
T-NI-UA-kunde2-1
i want matlab to search inside this cell. and find how many different names is there and how many of same names exist.
thanks for help

Respuestas (1)

dpb
dpb el 10 de Abr. de 2014
>> [u,~,ic]=unique(c);
>> histc(ic,1:length(u))
ans =
3
3
2
>> u
ans =
'T-NI-UA-kunde1-1'
'T-NI-UA-kunde1-2'
'T-NI-UA-kunde2-1'
>>

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by