function y=sgn(x) %% function y=sgn(x) %% sign function %% sign(x) = 1 if x>0 %% 0 if x=0 %% -1 if x<0 %% x input time pts %% y output response %% Copyright (C) Jin-Ting Zhang, Dept of Stat & Appl. Prob., NUS, Singapore %% 16/01/2002 y=(x>0)-(x<0);