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

1 次查看(过去 30 天)
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

回答(1 个)

dpb
dpb 2014-4-10
>> [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'
>>

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by