x解即w
feval 取x的值 fun的函数值越接近0越好
flag 判断解的情况
1 FSOLVE converged to a root.
2 Change in X too small.
3 Change in residual norm too small.
4 Computed search direction too small.
0 Too many function evaluations or iterations.
-1 Stopped by output/plot function.
-2 Converged to a point that is not a root.
-3 Trust region radius too small (Trust-region-dogleg) or
Regularization parameter too large (Levenberg-Marquardt).
-4 Line search failed.