Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: simple linear fit
Date: Wed, 16 Mar 2011 07:48:04 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 57
Message-ID: <ilppvk$jku$1@ginger.mathworks.com>
References: <ilpl9k$8n2$1@ginger.mathworks.com> <ilpm8s$shj$1@speranza.aioe.org> <ilppep$ica$1@ginger.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: ginger.mathworks.com 1300261684 20126 172.30.248.47 (16 Mar 2011 07:48:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 16 Mar 2011 07:48:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:716135

"Steve Sachay" wrote in message <ilppep$ica$1@ginger.mathworks.com>...
> "Nasser M. Abbasi" <nma@12000.org> wrote in message <ilpm8s$shj$1@speranza.aioe.org>...
> > 
> > You mean like
> > 
> > ---------------
> > %date
> > >> y = 9;
> > >> x = 4;
> > 
> > % ALGORITHM  ENGINE
> > >> A = y/x;  
> > 
> > %result
> > >> A*scale_factor
> > --------------
> > 
> > ans =
> >       9
> > 
> > --Nasser
> 
> 
> Thanks. Yes, that is exactly what I mean. Sorry I was not too clear, by sets of numbers, I meant a single scale factor that will bring one set as close as possible to the other. Least squares is fine, I already wrote it myself but there has to be a function for this.   
> 
> y=
> 
>      0.070451
>      0.060747
>      0.058232
>      0.054135
>      0.057377
>      0.045665
>      0.040489
>      0.037545
>       0.03935
>      0.033759
> 
> 
> x = 
>        1.2774
>        1.2609
>        1.2402
>        1.1554
>        1.3805
>        1.1212
>        1.1133
>        1.0016
>       0.85825
>       0.96502
> 
> The long way to do it of course: 

Shorterway
y'/x'

Bruno