Added scaleMatrix() function for 3D Matrices