How can I adjust my numbers

2 views (last 30 days)
Yosi Nifusi
Yosi Nifusi on 1 Jun 2016
Commented: Yosi Nifusi on 2 Jun 2016
Hello,
Lets say I have random 64.000 numbers. Min = -36.000 and Max is = 40.000, I want to make the minimum number equals to 0 and maximum number 255 and the rest of numbers has to be adjust accordingly. Is there any way that I can do such thing ?
Thank you,

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 1 Jun 2016
out = (yourarray - min1)/(max1-min1)*255
  1 Comment
Yosi Nifusi
Yosi Nifusi on 2 Jun 2016
Okay thanks, I have done something similar to that and its working

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!