1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
function y = f(x) if x > 0 y = 1; elseif x < 0 y = -1; else y = 0; end switch y case 1 disp('one'); otherwise disp('other'); end try risky(); catch y = 0; end end