Strmatch with multiple inputs possible?
Show older comments
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;
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!