MATLAB: How to reverse the normalization function normc/normr

normnormalization

I have used the function of "normr/normr" to normalize a matrix, but how can I reverse the normalization? Thank you very much!

Best Answer

If you haven't discarded the original data, there is nothing to restore. The "restored" matrix is the original one that you already have. If you plan to throw that data away, the best thing would be to save the row-wise (or column-wise) norms and use them when needed to undo normalization, e.g.,
A =
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
>> nr=sqrt(sum(A.^2,2)); %row-wise norms
>> B=bsxfun(@rdivide,A,nr) %same as B=normr(A)
B =
0.0602 0.3010 0.5417 0.7825
0.1091 0.3273 0.5455 0.7638
0.1493 0.3483 0.5473 0.7463
0.1826 0.3651 0.5477 0.7303
>> Arev=bsxfun(@times,B,nr) %reverse
Arev =
1.0000 5.0000 9.0000 13.0000
2.0000 6.0000 10.0000 14.0000
3.0000 7.0000 11.0000 15.0000
4.0000 8.0000 12.0000 16.0000