adjust function

Adjust the dimensions of a matrix to the dimensions of another matrix