function [fval,fpval] = myn2func(x) fval = cos(x)-x; fpval = -sin(x)-1;