how to find the order of the matrices