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

    function [mout,OK]= leastsq(m,x,y,Wc);
%LEASTSQ least squares estimate of model

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



if nargin<4
   Wc=[];
end
   
[m,OK]= InitModel(m,x,y,Wc);
if OK
   % Calculate coefficients
   m.Beta= calcBeta(m);
   mout=m;
else
   mout=m;
end