I am trying to compare two vectors, let's say
vec1 = [5 4 2 1 3 1 1 1 4];
vec2 = [5 4 2 5 3 2 1 2 2];
As you can see, they differ in indices 4, 6, 8, 9. I would like to determine how they differ, so that I get the following information:
The number 1 from vec1 is classified as a 5 in vec2 one time.
The number 1 from vec1 is classified as a 2 in vec2 two times.
The number 4 from vec1 is classified as a 2 in vec2 one time.
I would like to get it as a numerical result so that it is easier to work with, e.g.:
[1 5 1
1 2 2
4 2 1];
These vectors will be very long. Is there a fast way to go about this? Thank you all!
Best Answer