How to reverse the normalization function normc/normr?
14 次查看(过去 30 天)
显示 更早的评论
I have used the function of "normr/normr" to normalize a matrix, but how can I reverse the normalization? Thank you very much!
2 个评论
Image Analyst
2015-9-16
What happened to the original matrix? Why did you lose it?
I don't have the normr() function. Please list which toolbox it's in in the Products section below.
采纳的回答
Matt J
2015-9-16
编辑:Matt J
2015-9-16
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
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!