Path: news.mathworks.com!not-for-mail
From: "aasim Azooz" <aasimazooz@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help needed with Non-Linear Least Square Fitting
Date: Fri, 16 May 2008 13:42:01 +0000 (UTC)
Organization: Mosul University
Lines: 43
Message-ID: <g0k2v9$jem$1@fred.mathworks.com>
References: <g0i43e$n5i$1@fred.mathworks.com> <g0i4o4$2lt$1@fred.mathworks.com>
Reply-To: "aasim Azooz" <aasimazooz@yahoo.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210945321 19926 172.30.248.35 (16 May 2008 13:42:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 May 2008 13:42:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 277505
Xref: news.mathworks.com comp.soft-sys.matlab:468841


"Roger Stafford" 
<ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
message <g0i4o4$2lt$1@fred.mathworks.com>...
> "Nima Azar" <nimakev@yahoo.com> wrote in message 
<g0i43e$n5i
> $1@fred.mathworks.com>...
> > Hi Guys,
> > So I'm measuring Reflectance(v2) vs. Wavelength(v1) and 
> > need to find the thickness of my sample, for that I'm 
> > trying to use fitting to a function using the nonlinear 
> > square method to find couple of unknowns.
> > If anyone can help please email me at nimakev@yahoo.com 
so 
> > I'll send you more information,
> > any help is greatly appericiated.
> >  
> > thank you.
> -------------
>   I'm afraid my physics is a little rusty at this point.  
You need to tell in what way 
> sample thickness is to depend on reflectance and 
wavelength in your fitting 
> model.
> 
> Roger Stafford
> 
Try the following
write and save the following M-file
function f=v2(p,v1)
g=p(1);
h=p(2)
v2 = -a &#8211; b*v1 &#8211; c*(v1)^2 + d[1+(e/2d)cos((16.745*g/v1) + 
h)] Exp(-j/(v1)^2)

on matlab main work space type
p=[1 1];
p=nlinfit(v1,v2,'f',p)
this should give you the best fitted parameters g=p(1) and 
h=p(2)
please tell me how do you find thickness from reflectance I 
need to know that
Aasim Azooz