function L = limits(V, vmin, vmax)

  for i = 1 : length(V)
    L(i) = 0;
    if (V(i) < vmin)
      L(i) = -1;
    elseif (V(i) > vmax)
      L(i) = 1;
    endif
  endfor
  
endfunction
