private void setElem(int rowIndex, int colIndex, Complex z) {
        try {
            matrix[rowIndex][colIndex] = z;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }