public static void makeRandomDouble(Matrix matrix) throws MatrixIndexOutOfBoundsException {

        int rows = matrix.getRowsCount();
        int cols = matrix.getColsCount();
        double temp = 0;
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                // fill with random values
                temp = roundNumber(Math.random() * maxNumber, accuracy).doubleValue();
                matrix.setValue(i, j, temp);
            }
        }

    }