% derivfcn returns a value from the derivative of a simple function expression function y = derivfcn(x) y = 2*x;