Prev: [Help] set the direction of the dc motor with PWM in simulink
Next: PDF in matlab not the same as PDF in Excel
From: Matt J on 12 Aug 2010 12:31 "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 12 Aug 2010 17:33 Steve, Torsten, thank you so much for your help! It works now indeed! My best regards, Teresa
From: Teresa Cascino on 12 Aug 2010 18:42
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. |