Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linear regression
Date: Fri, 16 May 2008 09:28:29 -0400
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <g0k25t$nnb$1@fred.mathworks.com>
References: <13a0ad36-75d8-4ca0-b585-727d3a8ce1a9@w8g2000prd.googlegroups.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1210944509 24299 144.212.105.187 (16 May 2008 13:28:29 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 May 2008 13:28:29 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Xref: news.mathworks.com comp.soft-sys.matlab:468836



"fas" <faisalmufti@gmail.com> wrote in message 
news:13a0ad36-75d8-4ca0-b585-727d3a8ce1a9@w8g2000prd.googlegroups.com...
> Hi
> I want to do linear regression
> X_vec=a*Y_vec + b
> .
> .
> .
>
> where X_vec(1....100) and Y_vec (1..100) are vectors (say of size
> 100). So I have an overdetermined system where each vector value gives
> me one equation and I want to determine 'a' and 'b' after regression.
> I am bit novice any help?

Look at the Interactive Fitting and Programmatic Fitting sections of the 
Data Analysis documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/data_analysis/f1-6010.html

The first example on the Programmatic Fitting page does basically what you 
want.

-- 
Steve Lord
slord@mathworks.com