I would compare them by noting that the amplitudes of the peaks vary with respect to the independent variable, similarly for both ‘A’ and ‘B’. One way would be to do a simple linear regression of one against the other:
P = [A(:) ones(size(A(:)))] \ B(:)
another would be to regress both of them with respect to the independent variable (assumed here to be ‘x’):
Pa = [x(:) ones(size(x(:)))] \ A(:)
Pb = [x(:) ones(size(x(:)))] \ B(:)
A direct point-by-point difference or a single statistic (for example mean of the difference between them) would not capture their both changing over the independent variable at different rates, and with respect to each other.