added cases for matrix generation with more than 2 dimensions