"dal.luc" <dal.luc@gmail.com> wrote in message <a692e13544654d398da84bab9ca58909@v11g2000prb.googlegroups.com>...
> On 26 avr, 12:03, "John D'Errico" <woodch...@rochester.rr.com> wrote:
> > "dal.luc" <dal....@gmail.com> wrote in message <706dbbf2831e4f318a65dc13711e6...@j25g2000vbr.googlegroups.com>...
> > > Hello everybody,
> >
> > > I'am trying to use fminsearch but I got an error : I've surely did an
> > > error but I don'ty see where.
> > > Who can help me ?
> > > Let
> > > 1. Y a vector of observations (Y_1, Y_2, ... Y_n)
> > > 2. X = (X_1,X_2, ... X_n)
> > > 3. the function y=myfun(x,a,b) and myfun(x,a,b) = 1+1/(1+a*exp(b*x))
> > > I want to estimate a and b using the X and Y, minimizing the chi2 =
> > > sum(Y_i  myfun(X_i,a,b)^2).
> > > Let a0 and b0 the first estimations.
> > > The line : [x,fval] = fminsearch(@myfun,[a0,b0],Y,X) send me an
> > > error ...
> >
> > > If someone could help me, it would be great !
> > > Thnaks
> >
> > Surely, had you told us what error you got, we
> > might be better prepared to help you. Instead this
> > is now a guessing game, where we try to guess what
> > you did wrong.
> >
> > Did you not define myfun properly as a function,
> > perhaps trying to define an mfile at the command
> > line, or worse?
> >
> > Did you try to use / in myfun instead of ./ ?
> >
> > Are you not passing in a,b properly to myfun?
> >
> > Did you overload fminsearch by naming a file
> > with the same name?
> >
> > Did you find some other silly error that I have not
> > imagined?
> >
> > Tell us the complete error. MATLAB generates errors
> > to help you, so that the process of debugging things
> > is NOT a guessing game. Read the error.
> >
>
> That's what I did of course ! I am not stupid
Your lack of intelligent response belies that statement.
Tell us what you did if you expect a rational answer.
I suggested three completely different possibilities,
all of which were indeed possible based on your original
post.
If not, then perhaps the only rational answer you will
get is from matlab itself...
>> format rat
>> pi
ans =
355/113
