compare
5 views (last 30 days)
Show older comments
G=[1 0]with I={[1 0;1 1;0 0;1 0;1 1;0 1;1 0 random sequence]} i need to compare them and count number of matched bits
0 Comments
Answers (2)
the cyclist
on 23 Jul 2011
You can use the ismember() command, with the 'rows' option.
3 Comments
the cyclist
on 23 Jul 2011
Fangjun Jiang has kindly written the exact code you need. What's the problem?
Fangjun Jiang
on 23 Jul 2011
Probably there is no need to make I a cell array.
G=[1 0];
I=[1 0;1 1;0 0;1 0;1 1;0 1;1 0];
Compare=ismember(I,G,'rows');
Count=sum(Compare)
2 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices 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!