function b = linearmap(a,bmin,bmax)
%  b = linearm(a,bmin,bmax)
%      Maps interval values of a linearly into interval [bmin,bmax]
[m n] = size(a);
amin = min(min(a));
amax = max(max(a));
for ii = 1:m
  for jj = 1:n
    b(ii,jj) = bmin + ((a(ii,jj)-amin)/(amax-amin))*(bmax-bmin);
  end
end
