how to count the match
2 次查看(过去 30 天)
显示 更早的评论
if suppose I am matching some value with another values in loop and want to calculate no of matched and unmatched sequences .What code should I add for count?
0 个评论
回答(2 个)
per isakson
2012-7-21
I guess that if you are not more specific you'll get an answer like this :)
number_of_matches = 0;
...
if is_match
number_of_matches = number_of_matches + 1;
end
0 个评论
Eristoff Abhi
2012-7-21
As i am assuming that you are comparing two strings or two set of string: for eg: a={'count'} b={'count1', 'count2', 'count3','library','class','link'} now u can do x=strmatch(a,b); mat=length(x); unmat=length(b)-mat;
I hope this answer your doubt.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!