Help on matrix multiplication
Hi forum, Im trying to perform a matrix multiplication + addition but I am getting an error. Below are the 3 variables
Mat MatrixB = (Mat_<float>(5, 5) << 1, 0, 1, 0, 0,
0, 1, 0, 1, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
0, 0, 0, 0, 1);
Mat noise(5, 1, CV_32F, 0);
for (int i = 0; i < 200; i++) MatrixA.push_back(Mat::zeros(5, 1, CV_32F));
Noise and MatrixA gets initialized to some value. However when I do the following operation MatrixA = MatrixB * MatrixA + noise I get an error.
which error(s) ?
For me there is a problem with the dimension of the matrices. What is the size of MatrixA (it should be 5x1) ?
@HasiqBR, i think, you wanted:
(a [5x200] Mat, not a [1x1000] one) .
and then, it should be