'Function to write out basic details to the matrix object'

def writeToMatrix(self, matrix, row, col, langDict={}, answerMatrix=None):

    self._store_metadata()
    startrow = row
    startcol = col
    mergeLH = 0
    mergeLV = 0
    height = 0
    width = 0
    if self.label:
        _TQstn = self._Tquestion(langDict)
        cell = survey_MatrixElement(row, col, _TQstn, style='styleSubHeader')
        (width, height) = self.getLabelSize()
        mergeLH = (width - 1)
        mergeLV = (height - 1)
        cell.merge(mergeLH, mergeLV)
        matrix.addElement(cell)
        if self.labelLeft:
            col += (1 + mergeLH)
        else:
            row += (1 + mergeLV)
    cell = survey_MatrixElement(row, col, '', style='styleInput')
    mergeWH = self.xlsWidgetSize[0]
    mergeWV = self.xlsWidgetSize[1]
    cell.merge(mergeWH, mergeWV)
    matrix.addElement(cell)
    if self.labelLeft:
        height = max(height, (mergeWV + 1))
        width += (mergeWH + 1)
    else:
        height += (mergeWV + 1)
        width = max(width, (mergeWH + 1))
    self.addPaddingAroundWidget(matrix, startrow, startcol, (mergeLH + 1), (mergeLV + 1), (mergeWH + 1), (mergeWV + 1))
    self.addPaddingToCell(matrix, startrow, startcol, (startrow + height), (startcol + width))
    height += self.xlsMargin[1]
    width += self.xlsMargin[0]
    if (answerMatrix != None):
        answerRow = (answerMatrix.lastRow + 1)
        cell = survey_MatrixElement(answerRow, 0, self.question['code'], style='styleSubHeader')
        answerMatrix.addElement(cell)
        cell = survey_MatrixElement(answerRow, 3, self.rowcol_to_cell(row, col), style='styleText')
        answerMatrix.addElement(cell)
    endcol = (startcol + width)
    endrow = (startrow + height)
    if DEBUG:
        self.verifyCoords(endrow, endcol)
    return (endrow, endcol)
