Create a Matrix:
cv::Mat Matrix= (cv::Mat_<float>(3, 3) << 0, 1, 0, 1, -4, 1, 0, 1, 0);
Use the Mat_ Object to access the values:
cv::Mat_<float> Matrixvals= Matrix;
Matrixvals(1,0) = 2;
Matrixvals(1,1) = -8;
Matrixvals(1,2) = 2;