Matrix row, col, rotate, transpose functions