1; function retval = test (x) retval = 1/2 * x if x < 3 retval = 1/4 * x elseif x > 6 retval = 3/4 * x endif endfunction function retval = other (x) retval = sin(x) endfunction x = 0 : 0.01 : 2*pi plot( x, test(x), "1;Odd Function;", x, other(x), "2;Sine;" )