private static RealMatrix csvToMatrix(final String sourceFilePath) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader(sourceFilePath));
        double[][] matrixArray = null;

        while (in.ready()) {
            String currentLine = in.readLine();

            if (currentLine.startsWith("#") || currentLine.trim().isEmpty()) {
                continue;
            }

            String[] tokens = currentLine.split(",");

            if (matrixArray == null) {
                matrixArray = new double[0][tokens.length];
            }

            double[][] tmpArray = new double[1][tokens.length];

            for (int i = 0; i < tokens.length; ++i) {
                if (!tokens[i].trim().isEmpty()) {
                    tmpArray[0][i] = Double.parseDouble(tokens[i]);
                }
            }

            matrixArray = concat(matrixArray, tmpArray);
        }

        return MatrixUtils.createRealMatrix(matrixArray);
    }