Find out the maximum value of your gain and subtract all the values w.r.t that maximum value in that way you can get the normalized value of gain. Ex. Let the maximum gain value is 5db and minimum is - 30db for complete 180 degree. So if you normalize it w. r. t 5 you will get 0 and - 35.
Take the data and save it in [A]. Suppose, it is in dB i.e. all data of Mat[A] are in dB. Then find max(A) and suppose it is 'm'. then subtract 'm' from each matrix element. After that, suppose, you got [A]_nom, then max value of that newly generated matrix will be '0' (dB)