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!