scaleMatrix function

Function to scale matrices