Thread Subject: curve fitting

Subject: curve fitting

From: Mohammad Monfared

Date: 3 Nov, 2008 10:57:02

Message: 1 of 3

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,

Subject: curve fitting

From: dcorrea

Date: 3 Nov, 2008 13:22:00

Message: 2 of 3


Hello

Can you try to use CURVE FITTING Tool (Interface Graphic)

>> cftool

Greetings
David C.



On Nov 3, 5:57=A0am, "Mohammad Monfared" <gohardo...@gmail.com> wrote:
> Hi everybody,
> I'm trying to fit a curve of a custom equation to my data using matlab, b=
ut I can't get any answer. Could anyone suggests where is the problem.
>
> x1=3D[0 2 50 106 250 500 1000 2000];
> y1=3D[0 0.03 0.17 0.279 0.735 0.921 0.994 1.002];
> s =3D fitoptions('Method','NonlinearLeastSquares',...
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'Lower',[0,0,0,0],...
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'Upper',[1000,10,10,10],...
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'Startpoint',[100,2,1,1]);
> fredfitype=3Dfittype('(1/log(exp(1)+(ag/x)^ng)^mg)*(1-(log(1+(dg)/x)/log(=
1+dg=AD)))^7','options',s);
> [c0] =3D fit(x1,y1,fredfitype);
>
> I know from SPSS software that the answer is:
> ag=3D250 ; ng=3D2.944 ; mg=3D1.2 ; dg=3D3.059 ;
>
> thanks so much,

Subject: curve fitting

From: Mohammad Monfared

Date: 3 Nov, 2008 16:48:02

Message: 3 of 3

I've tried it too (with larger numbers for MaxIteration and Fun-eval, parameters) , but no answer !

thanks,
Mohammad M.


dcorrea <david.correa@gmail.com> wrote in message <f5ab4c87-65da-4dfa-aa4f-196f220acfd4@v16g2000prc.googlegroups.com>...
>
> Hello
>
> Can you try to use CURVE FITTING Tool (Interface Graphic)
>
> >> cftool
>
> Greetings
> David C.
>
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com