Home > . > clip.m

clip

PURPOSE ^

out= clip(in, low, high)

SYNOPSIS ^

function [out]= clip(in, low, high)

DESCRIPTION ^

out= clip(in, low, high)
 Clips data (scalar, vector or matrix) so that for every element
 LOW <= IN<= HIGH. LOW can be '-inf', and HIGH can be 'inf', for
 one sided operations.

 data   = input matrix, vector or scalar
 low    = lower scalar value
 high   = (optional) upper scaler value
 out    = clipped output data.

Examples:  out = clip(in, 0)  all   values < 0 set = 0
           out = clip(in, 0, 255)   clip to [0, 255]
           out = clip(in, -inf, 10) out < or = 10
        
  Author: Peter Burns, 1 Oct. 2008
  Copyright (c) 2007 Peter D. Burns

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 27-Jul-2009 13:44:16 by m2html © 2003