solve Wolfe function using matlab