Path: news.mathworks.com!not-for-mail
From: "Lorenzo Guerrasio" <lorenzo.guerrasio@email.it>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to plot 2 fitting lines in 1 dataset?
Date: Fri, 5 Jun 2009 20:18:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <h0buhq$832$1@fred.mathworks.com>
References: <h0bk5u$cha$1@fred.mathworks.com>
Reply-To: "Lorenzo Guerrasio" <lorenzo.guerrasio@email.it>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244233082 8290 172.30.248.37 (5 Jun 2009 20:18:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Jun 2009 20:18:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1371978
Xref: news.mathworks.com comp.soft-sys.matlab:545116



you can use logical indexing to divide your data set and make a fit for each group.

regards
"Kuo-Hsien" <mchangks@hotmail.com> wrote in message <h0bk5u$cha$1@fred.mathworks.com>...
> Hi all,
> 
> My dataset can be categorized into 2 groups by eyes, so can I plot 2 fitting lines for this dataset? Right now, I just use polyfit function, but it fits for all data points. Thanks.
> 
> Michael