You can resolve this error by making sure the dimensions agree.
If you think this answer is unhelpful; it is. If you want a more helpful answer you will have to provide more details.
An element-wise multiplication will work if isequal(size(A),size(B)). If non-matching dimensions are of length 1 and you are using R2016b or later, implicit expansion will cause expansion into an array: