From: Sadegh on
Dear all,

I have a problem with Curve fitting to do plot the non linear data, acually i dont know how i can i write my code in handel function form.
my data is
t=[0 1 5 10 30 60];
x =[0 6.184643214 12.3971795732342 15.5396860252275 30.2822273003942 43.5891026211365];

plot(t,x,'o');
xlabel('Time'); ylabel('Blood Concentration');

and my equation is :A*(log(1+B*t))=x

coefEsts = nlinfit(t,x, modelFun, startingVals);
I wonder to know how can i write my equation in modelfun in nlinfit command and what should be the starting point.

Please Kindly send me solution as soon as poss
From: John D'Errico on
"Sadegh " <sadegh.pub(a)gmail.com> wrote in message <hqsl1q$6rg$1(a)fred.mathworks.com>...
> Dear all,
>
> I have a problem with Curve fitting to do plot the non linear data, acually i dont know how i can i write my code in handel function form.

A Handel function? Like this?

load handel
sound(y,Fs)


> my data is
> t=[0 1 5 10 30 60];
> x =[0 6.184643214 12.3971795732342 15.5396860252275 30.2822273003942 43.5891026211365];
>
> plot(t,x,'o');
> xlabel('Time'); ylabel('Blood Concentration');
>
> and my equation is :A*(log(1+B*t))=x
>
> coefEsts = nlinfit(t,x, modelFun, startingVals);
> I wonder to know how can i write my equation in modelfun in nlinfit command and what should be the starting point.
>
> Please Kindly send me solution as soon as poss

Oh, THAT kind of handle. How boring.

fun = @(coef,t) coef(1)*log(1+coef(2)*t);
nlinfit(t,x,fun,[1,10])
ans =
17.753 0.16543

John