Nov-01-2019, 09:20 PM
(Nov-01-2019, 08:33 PM)newbieAuggie2019 Wrote:I am thinking that this might be slower...but thanks for replying.(Nov-01-2019, 10:22 AM)masteripper Wrote: Suppose you have 3 matrices :
A =
1 0 1 1 1 0 0 1
1 0 0 1 1 0 0 1
1 0 1 0 0 0 0 0
1 0 0 0 1 0 0 1
B =
0 1 0 0 1 0 0 1
1 1 0 0 0 0 0 1
1 1 1 0 0 0 0 1
1 0 1 0 1 0 0 1
C =
1 0 1 0 1 0 0 1
1 0 1 1 1 0 0 1
1 0 1 0 0 0 0 1
1 1 0 0 1 0 0 1
[ ... ] in this case Matrix A is more matching to Matrix C in comparison to B.
Hi!
My approach would be comparing matrix A and matrix B, element by element, and keep the number of elements in common in a variable, named, let's say commonElementsAB.
Then, I would do the same, comparing matrix A and matrix C, element by element, and keep the number of elements in common in a variable, named, let's say commonElementsAC.
After that, I would compare the value of commonElementsAB with the value of commonElementsAC. If the value of commonElementsAB is greater than the value of commonElementsAC, that means that Matrix A is more matching to Matrix B than to Matrix C. If the value of commonElementsAC is greater than the value of commonElementsAB, that means that Matrix A is more matching to Matrix C than to Matrix B.
All the best,