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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -