I would recommend converting one channel to three channels:
Mat A = Mat::zeros(100, 200, CV_32FC1);
Mat B = Mat::zeros(100, 200, CV_32FC3);
// Mat C = A.mul(B); // Sizes of input arguments do not match
Mat Afc3;
Mat t[] = {A, A, A};
merge(t, 3, Afc3);
Mat C = Afc3.mul(B); // now Afc3 has 3 channels ans it is type of 32_FC3
// we can multiply each elem in B by the same coef from A
But if B is a type CV_8UC3, it does not work, because opencv will not allow multiplying Mats that have different types of pixels. In this case, convert 8UC3 to 32FC3 to convert each pixel to 1 / 255.0, each pixel in 32FC3 has a value from 0.0 to 1.0 (and, of course, each pixel in 8UC3 has a value from 0 to 255).
Mat A = Mat::zeros(100, 200, CV_32FC1);
Mat B = Mat::zeros(100, 200, CV_8UC3);
// Mat C = A.mul(B);
Mat Afc3, Bfc3;
Mat t[] = {A, A, A};
merge(t, 3, Afc3);
B.convertTo(Bfc3, CV_32FC3, 1/255.0);
Mat C = Afc3.mul(Bfc3);