Pattern Finding In Matrices Code will genrate a random Logical Matrice , but you can use mat.txt as input