LINEAR_TRANSITION Functrion having a linear transition between 0 and 1 As the Heaviside function, but with extended transition between 0 and 1. The output is 0 for the range [-Inf,xbp0], 1 for [xbp1,Inf] and a linear transition between 0 and 1 for [xbp0,xbp1]. FORMAT h = linear_transition(xbp0,xbp1,x) OUT h The weight for each point in x, a value between 0 and 1 IN xbp0 The breakepoint at 0 xbp1 The breakepoint at 1 x The points where h shall be calculated

0001 % LINEAR_TRANSITION Functrion having a linear transition between 0 and 1 0002 % 0003 % As the Heaviside function, but with extended transition between 0 and 1. 0004 % The output is 0 for the range [-Inf,xbp0], 1 for [xbp1,Inf] and a linear 0005 % transition between 0 and 1 for [xbp0,xbp1]. 0006 % 0007 % FORMAT h = linear_transition(xbp0,xbp1,x) 0008 % 0009 % OUT h The weight for each point in x, a value between 0 and 1 0010 % IN xbp0 The breakepoint at 0 0011 % xbp1 The breakepoint at 1 0012 % x The points where h shall be calculated 0013 0014 % 2014-01-15 Patrick Eriksson 0015 0016 function h = linear_transition(xbp0,xbp1,x) 0017 0018 h = max( min( (x-xbp0)/(xbp1-xbp0) , 1 ), 0 ); 0019

Generated on Mon 15-Sep-2014 13:31:28 by