From: Matt J on
"Teresa Cascino" <teresacascino(a)gmail.com> wrote in message <i3v99p$3qb$1(a)fred.mathworks.com>...

> [x,fval,exitflag,output] = fmincon(@(x)BondParameters(beta,alpha,sigma,gamma,eta),x0,[],[],[],[],lb,ub)
=======================

The syntax you want is this

[x,fval,exitflag,output] = ...
fmincon(@(x)BondParameters(x(1),x(2),x(3),x(4),x(5)),x0,[],[],[],[],lb,ub)

Alternatively, you can rewrite BondParameters(x) as a 1-argument function of a length 5 variable x. Inside BondParameters(x), you can extract beta,alpha, etc... from x, as I have done above.
From: Teresa Cascino on
Steve, Torsten,

thank you so much for your help! It works now indeed!

My best regards,

Teresa
From: Teresa Cascino on
Thank you vm, Matt, very precious help!

"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i417kb$i8s$1(a)fred.mathworks.com>...
> "Teresa Cascino" <teresacascino(a)gmail.com> wrote in message <i3v99p$3qb$1(a)fred.mathworks.com>...
>
> > [x,fval,exitflag,output] = fmincon(@(x)BondParameters(beta,alpha,sigma,gamma,eta),x0,[],[],[],[],lb,ub)
> =======================
>
> The syntax you want is this
>
> [x,fval,exitflag,output] = ...
> fmincon(@(x)BondParameters(x(1),x(2),x(3),x(4),x(5)),x0,[],[],[],[],lb,ub)
>
> Alternatively, you can rewrite BondParameters(x) as a 1-argument function of a length 5 variable x. Inside BondParameters(x), you can extract beta,alpha, etc... from x, as I have done above.