www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregoptmgr/ssenonlin.m
function [cost,g]= ssenonlin(B,F,c0,m,x,y,varargin) %SSENONLIN % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargout==1 res= feval(F.costFunc,B,m,x,y,varargin{:}); else [res,J]= feval(F.costFunc,B,m,x,y,varargin{:}); g= -2*res'*J; end cost = sum(res.*res);