xhat=-1:0.1:1; [g dg d2g] = masterp1(1,xhat); a=3;b=7; x=a*g(1,:)+b*g(2,:); plot(xhat,0,x,0)