フィルターのクリア

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

1 回表示 (過去 30 日間)
awda
awda 2014 年 4 月 10 日
回答済み: dpb 2014 年 4 月 10 日
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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by