필터 지우기
필터 지우기

[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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by