Path: news.mathworks.com!not-for-mail
From: "Stuart " <imanotarat@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: best fit line through coordinates
Date: Sat, 16 Oct 2010 06:25:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <i9bgg3$3c4$1@fred.mathworks.com>
References: <i9bf4s$9dq$1@fred.mathworks.com>
Reply-To: "Stuart " <imanotarat@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1287210307 3460 172.30.248.38 (16 Oct 2010 06:25:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 16 Oct 2010 06:25:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2482755
Xref: news.mathworks.com comp.soft-sys.matlab:678950

Go look up the demo on the function polyfit, u can tell it to make a first order regression of those points which would be the line of best fit


"Kurt " <rerty258@gmail.com> wrote in message <i9bf4s$9dq$1@fred.mathworks.com>...
> Hi guys,
> 
> I have an issue I'd like some help with.
> 
> 
> coordinates =
> 
>                     107.35                       107                    111.51                       146
>                        117                    154.61                    111.29                       114
> 
> 
> In the above matrix 'coordinates', its actually in the form [ x1 y1 x2 y2] for each of the 2 rows.
> 
> Is there any function I can obtain a best fit line using these 4 points?
> 
> 
> thanks
> Kurtis