Path: news.mathworks.com!not-for-mail
From: "Mohammad Monfared" <gohardoust@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: curve fitting
Date: Mon, 3 Nov 2008 10:57:02 +0000 (UTC)
Organization: gol
Lines: 18
Message-ID: <gemldt$oq2$1@fred.mathworks.com>
Reply-To: "Mohammad Monfared" <gohardoust@gmail.com>
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 1225709822 25410 172.30.248.37 (3 Nov 2008 10:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 3 Nov 2008 10:57:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 93829
Xref: news.mathworks.com comp.soft-sys.matlab:498602


Hi everybody,
I'm trying to fit a curve of a custom equation to my data using matlab, but I can't get any answer. Could anyone suggests where is the problem.

x1=[0 2 50 106 250 500 1000 2000];
y1=[0 0.03 0.17 0.279 0.735 0.921 0.994 1.002];
s = fitoptions('Method','NonlinearLeastSquares',...
               'Lower',[0,0,0,0],...
               'Upper',[1000,10,10,10],...
               'Startpoint',[100,2,1,1]);
fredfitype=fittype('(1/log(exp(1)+(ag/x)^ng)^mg)*(1-(log(1+(dg)/x)/log(1+dg)))^7','options',s);
[c0] = fit(x1,y1,fredfitype);

I know from SPSS software that the answer is:
ag=250 ; ng=2.944 ; mg=1.2 ; dg=3.059 ;

thanks so much,