Adding generic print function for all the available matrix types