how to count the match
조회 수: 7 (최근 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에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!