function y=f(x) % The function must be able to take x as a vector and % returns y as a vector of the same size in this case. % Thus, one should use ".*", "./" and ".^" instead of "*", "/" and "^" % as in the example below: % y=(x.*(x+2)+x.^4)./x; y=sin(x+1); return