MATLAB求分段函数 x = input('') if x<0 && x~=-3 fx=x*x+x-6 elseif x>=0 && x<5 && x~=2 && x~=3 fx=x*x-5*x+6 else fx=x*x-x-1 end disp(fx)