66 views (last 30 days)

Show older comments

njj1
on 8 Mar 2018

What do you mean by "similar"? If you want simply see the number of entries that are the same, then this could do the trick:

s = A==B; %this is a boolean vector that will be 1 if the entries are the same and 0 if different

similarity = sum(s)/numel(s); this is the number of entries that are equal divided by the total number of entries

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!