From: Oleg Komarov on 16 Mar 2010 06:49 "Satish " <dhungana(a)kth.se> wrote in message <hnnbh1$cun$1(a)fred.mathworks.com>... > dpb <none(a)non.net> wrote in message <hnm43d$7u9$1(a)news.eternal-september.org>... > > > Of course you can; it's simply a linear transformation -- you have two > > points (min/max values) you want to scale to another range. That boils > > down to solving two equations in two unknowns... > > > > -- > > Hi dpb, > > Thanks , Finally i made it with linear transformation using following formula. > > value=((y(i) + abs(min(y)))/(max(y)-min(y)))*100 > > If you have also any other formula than let me know. you can rearrange your formula to: value = (y + abs(min(y))) / range(y) * 100 Note that you don't need to loop here. Oleg
From: ImageAnalyst on 16 Mar 2010 08:19
Why are you taking the absolute value of the min? Why not simply use the regular, usual normalization equation: normalizedY = (Y - min(Y)) / range(Y) * 100 Don't bother taking the abs(). |