request test in Matlab

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

request test in Matlab

Olaf Till-2
Hi,

could someone test in the following in Matlab? (I'd like to know which
call to lsqcurvefit causes an error message.)


problem.solver = 'lsqcurvefit';
problem.objective = @ (p,x) p(1) + p(2) * exp (-x);
problem.x0 = [1, 1];
problem.xdata = [0 .3 .8 1.1 1.6 2.3];
problem.ydata = [.82 .72 .63 .60 .55 .50];
problem.lb = [0, 0];
problem.options = optimset ('TolFun',1e-100);

p = lsqcurvefit (problem)

problem.fun = @ (p,x) p(1) + p(2) * exp (-x);

p = lsqcurvefit (problem)


Thanks, Olaf

--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: request test in Matlab

Michele Ginesi
On 10/27/18 12:03 PM, Olaf Till wrote:

> Hi,
>
> could someone test in the following in Matlab? (I'd like to know which
> call to lsqcurvefit causes an error message.)
>
>
> problem.solver = 'lsqcurvefit';
> problem.objective = @ (p,x) p(1) + p(2) * exp (-x);
> problem.x0 = [1, 1];
> problem.xdata = [0 .3 .8 1.1 1.6 2.3];
> problem.ydata = [.82 .72 .63 .60 .55 .50];
> problem.lb = [0, 0];
> problem.options = optimset ('TolFun',1e-100);
>
> p = lsqcurvefit (problem)
>
> problem.fun = @ (p,x) p(1) + p(2) * exp (-x);
>
> p = lsqcurvefit (problem)
>
>
> Thanks, Olaf
>
Dear Olaf,

I attach the diary. I use Matlab2018a.

Bests,

Michele

Reply | Threaded
Open this post in threaded view
|

Re: request test in Matlab

Olaf Till-2
On Sat, Oct 27, 2018 at 12:58:40PM +0200, Michele wrote:

> On 10/27/18 12:03 PM, Olaf Till wrote:
> > Hi,
> >
> > could someone test in the following in Matlab? (I'd like to know which
> > call to lsqcurvefit causes an error message.)
> >
> >
> > problem.solver = 'lsqcurvefit';
> > problem.objective = @ (p,x) p(1) + p(2) * exp (-x);
> > problem.x0 = [1, 1];
> > problem.xdata = [0 .3 .8 1.1 1.6 2.3];
> > problem.ydata = [.82 .72 .63 .60 .55 .50];
> > problem.lb = [0, 0];
> > problem.options = optimset ('TolFun',1e-100);
> >
> > p = lsqcurvefit (problem)
> >
> > problem.fun = @ (p,x) p(1) + p(2) * exp (-x);
> >
> > p = lsqcurvefit (problem)
> >
> >
> > Thanks, Olaf
> >
>
> Dear Olaf,
>
> I attach the diary. I use Matlab2018a.
>
> Bests,
>
> Michele
Thanks! (so Matlab indeed accepts the field 'objective'...)

Olaf

--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

signature.asc (849 bytes) Download Attachment