From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: simple linear fit
Date: Wed, 16 Mar 2011 08:16:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 6
Message-ID: <ilprk4$nii$>
References: <ilpl9k$8n2$> <ilpm8s$shj$> <ilppep$ica$> <ilppvk$jku$> <ilpqtm$ls8$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1300263364 24146 (16 Mar 2011 08:16:04 GMT)
NNTP-Posting-Date: Wed, 16 Mar 2011 08:16:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:716143

"Steve Sachay" wrote in message <ilpqtm$ls8$>...
> Thank you very much. Both methods posted give me the same answer of course, but slightly different than my explicit method.  I have to say "by eye" my fit looks the best but they are both very good. 

All three methods are based on least-square criteria, and should give the same result. The discrepancy you have seen is due to not fully converge by fminsearch. If it looks better, it's just pure luck.