MATLAB: Stuck with simple matrix calculation, can you help

matrixmatrix manipulationproductsum

So I have two matrixes, both 44×72, let's call them A and V. What I need to do is multiply each value in row/column "ij" by the same value in the other matrix. Then I need to sum all these values up and divide by the sum of all the values in matrix A. Here's another way to think about what I need to do:
Answer = Sum(Aij x Vij) / Sum(Aij) over all i,j grid cells
Sounds easy to do but I can't figure it out. Thanks in advance for the help!
Aaron

Best Answer

B=A.*V;
SumA=sum(sum(A));
if SumA~=0
C=sum(sum(B))/SumA;
end