% SCALES REAL VECTORS INTO 0 TO 255 RANGE
%
% y = scaler([0 1 2]);  % gives  [0 128 255]
%
% y = scaler([0 1 2],100) % gives [0 50 99]
%
% y = scaler(vector,number_of_quantization_levels)

function y = dummy_name(x,maximumplusone)

if min(size(x)) >1
  error('scaler: i only deal with 1d matrices (vectors)');
end%if

if nargin == 1
  maximumplusone = 256;
end%if

minx=min(x);
maxx=max(x);

y = round( (x-minx)*(maximumplusone-1)/(maxx-minx) );

