www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregmultilin/leastsq.m

    function [mout,OK]= leastsq(m,varargin);
% xreglinear/LEASTSQ least squares estimate of model

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.




[mout,OK]= leastsq(get(m,'currentmodel'),varargin{:});
% change weights so 
n= get(m,'currentindex');
wts= zeros(1,get(m,'nmodels'));
wts(n)=1;
set(m,'weights',wts);
mout=set(m,'currentmodel',mout);