%% Scale to Specified Range
% Scale the elements of a vector to the interval [-1,1].

A = 1:5;
B = rescale(A,-1,1)

% Copyright 2012 The MathWorks, Inc.