Generates the entire matrix from a basis and gives Hamming Distance between all the elements