matlab - How to convert data from [-1,1] to [0,255]? -
i have arrays of data in range [-1,1] , need convert them range [0,255] in matlab. either formula or code! (i checked matlab functions not find function related conversion!)
see small piece of exmaple code.
n = 10; = 2*rand(1,n) - 1; % random data in [-1,1] b = 255/2*(a+1); % linear projection [0,255]
Comments
Post a Comment