From: anna fu on
hi, everyone!

when i use lsqcurvefit for four-parameter curve fitting, i find that the lower and upper bounds cannot be added to the function. otherwise, there is errors as the following.
Exiting due to infeasibility: 1 lower bound exceeds the corresponding upper bound.
the number may 2 or 4 under different conditions.

are there any errors in the usage?
[p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] = lsqcurvefit(@mymodel1, start0, xdata, ydata, 'lb', [1 Pm 1 1], 'ub', [Pm (middle + 1) * Pm Pm Pm], 'option');

there is error too if the function is changed to the following form.
[p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] = lsqcurvefit(@mymodel1, start0, xdata, ydata, [1 Pm 1 1], [Pm (middle + 1) * Pm Pm Pm], 'option');

??? Error using ==> optimget at 37
First argument must be an options structure created with OPTIMSET.

Error in ==> lsqncommon at 123
mtxmpy = optimget(options,'JacobMult',[]); % use old

Error in ==> lsqcurvefit at 186
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...

Error in ==> decon_lsqct_1DA at 40
[p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] =
lsqcurvefit(@EMGmodel_sumA, start0, xdata, ydata, [1 Pm 1 1], [Pm
(middle + 1) * Pm Pm Pm], 'option');

so, how to use the function lsqcurvefit correctly? thanks a lot for ur efforts.

anna
From: Steven Lord on

"anna fu" <chuanbi.fu(a)gmail.com> wrote in message
news:hm1oup$aer$1(a)fred.mathworks.com...
> hi, everyone!
>
> when i use lsqcurvefit for four-parameter curve fitting, i find that the
> lower and upper bounds cannot be added to the function. otherwise, there
> is errors as the following.
> Exiting due to infeasibility: 1 lower bound exceeds the corresponding
> upper bound.
> the number may 2 or 4 under different conditions.
>
> are there any errors in the usage?
> [p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] =
> lsqcurvefit(@mymodel1, start0, xdata, ydata, 'lb', [1 Pm 1 1], 'ub', [Pm
> (middle + 1) * Pm Pm Pm], 'option');
>
> there is error too if the function is changed to the following form.
> [p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] =
> lsqcurvefit(@mymodel1, start0, xdata, ydata, [1 Pm 1 1], [Pm (middle + 1)
> * Pm Pm Pm], 'option');

Yes, both those will error as they don't correspond to a valid calling
syntax for LSQCURVEFIT. Reread the reference page (doc lsqcurvefit) -- it
will list the syntax that the function supports. Your second syntax is
close, but you don't need to pass the _name_ of the options structure but
the options structure itself.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Bruno Luong on
"anna fu" <chuanbi.fu(a)gmail.com> wrote in message <hm223t$98k$1(a)fred.mathworks.com>...
> hi, everyone!
>
> when i use lsqcurvefit for four-parameter curve fitting, i find that the lower and upper bounds cannot be added to the function. otherwise, there is errors as the following.
> Exiting due to infeasibility: 1 lower bound exceeds the corresponding upper bound.
> the number may 2 or 4 under different conditions.
>
> are there any errors in the usage?
> [p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] = lsqcurvefit(@mymodel1, start0, xdata, ydata, 'lb', [1 Pm 1 1], 'ub', [Pm (middle + 1) * Pm Pm Pm], 'option');
>
> there is error too if the function is changed to the following form.
> [p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] = lsqcurvefit(@mymodel1, start0, xdata, ydata, [1 Pm 1 1], [Pm (middle + 1) * Pm Pm Pm], 'option');
>
> ??? Error using ==> optimget at 37
> First argument must be an options structure created with OPTIMSET.
>
> Error in ==> lsqncommon at 123
> mtxmpy = optimget(options,'JacobMult',[]); % use old
>
> Error in ==> lsqcurvefit at 186
> [x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
>
> Error in ==> decon_lsqct_1DA at 40
> [p4_resu, resnorm, residual, exitflag, output, lambda, jacobian] =
> lsqcurvefit(@EMGmodel_sumA, start0, xdata, ydata, [1 Pm 1 1], [Pm
> (middle + 1) * Pm Pm Pm], 'option');
>
> so, how to use the function lsqcurvefit correctly? thanks a lot for ur efforts.

The error message is clear: the OPTION argument must be a structure. What do you pass?

Bruno