Strmatch with multiple inputs possible?
이전 댓글 표시
Was wondering if Strmatch can have multiple inputs checking the outputs of the users array? For example I have an array (5,1) where each row has a different name such as Cat, Dog, Alligator... I would like to see how many times each have been repeated in a (:,1) array. Strmatch is compatable as long as my array is only a 1:1 size but any other size it outputs a zero as amount of times a word has been repeated. Maybe there is something better then strmatch? My code is below.. Where str is the (current) (1:1) and want the (5:1) and MeterType is the array I am checking the strings to.
ind = strmatch(str, MeterType);
numTimesEntered = length(ind);
save numTimesEntered;
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!