syms x;f =picewise(x>0,sin(x),x<=0,1-cos(x))x0=-4:0.1:4;f1=subs(f,x,x0);plot(x0,f1)limt(f,x,inf)
limit(f,x,inf)的结果为
ans = NaN
图像: