function f = fun(q) global Xnew L ell f = Xnew - h(q); end