One way amongst many --
BINS=categorical([-1:1],[-1:1],["Low","Med","High"]); % the end categories
YrTotal=sum(sign(M_Avg-Th_Val)); % year difference relative thresholds
YrBin=BINS(interp1([-12,-11,11,12],[1,2,2,3],YrTotal).'); % the year bin classification
Algorithm: There is only one set of values that will equate to high or low as long as the criterion is "all" must exceed or be below the threshold(*). In that case the sum of the sign() of the difference is +/-12; anything else is "Med". Since the sum() must also be an integer in the range [-12,12], it's simple to interpolate between and return the bin number as integer between [1;3], the array of BINS.
This seems an extreme definition; one would think this would almost never occur.