function y=limit(x,min,max); % Syntax: y=limit(x,min,max); % % limiting the values of x to the interval [min,max]. % Useful for. ex. when writing audio files. if (min>max) error ('strange..., min>max'); end indices=find(x>max); x(indices) = max * ones (size(indices)); indices=find(x