The code below can help perform matrix normalization where you have to specify the appropriate -1, 0 and 1 values in variables "pointZero", "pointPositive" and "pointNegative". Any value lower than -1 is set to -1 and any value greater than one is set to 1.
Assuming "a" is your matrix,
a = (a - pointZero)/(pointPositive-pointNegative);
Note that the points raised by dpb are valid and could affect the properties of the values in the matrix.
Hope this helps!