A simple solution is using ready MATLAB function :
mapminmax
Process matrices by mapping row minimum and maximum values to [-1 1]
Example :
x1 = [1 2 4; 1 1 1; 3 2 2; 0 0 0]
[y1,PS] = mapminmax(x1)
Denormalize that vector after normalization
x1_again = mapminmax('reverse',y1,PS)