function [b] = limit_max_and_min(m)

[r,c] = size(m);

for i=1:r,
  for j=1:c,
    if m(i,j)>10,  m(i,j)=10;  end;
    if m(i,j)<-10, m(i,j)=-10; end;
  end
end

b=m;
