sign()

    t=-5:0.00001:5; f=sign(t);%直接使用sign() plot(t,f,’b-‘) axis([-5 5 -2 2]) title(‘图1-9 符号函数’)