excuse me, how can set a tolerance? because I want to solve this:( I mean finding "cc" which satisfies below)
* F(cc)<=min(F(c))+(0.5)^k *
and k k is iteration number. in paper, writer said that tolerance should be set on "(0.5)^k". I've written a az below,but it doesn't work.
objfcn = @(cc) fmp_cmp(cc, Uu, Cc, mm, p); options = optimset('TolFun', delta^k); A = [ones(1,24)]; b =; cc0=rand(1,24); cc0=cc0/sum(cc0); [cc,fval]=fmincon(objfcn,cc0,,,A,b,zeros(1,24),ones(1,24),options);
No products are associated with this question.
Your 'options' should be the 10th input argument to fmincon. You have passed it as the 9th. If you have no nonlinear constraints, set that to .
Where did ‘F’ come from? It’s not in AA.m or fmp_cmp.m. It’s obviously a function, because ‘cc’ is a (1x24) double vector. Also, ‘c’ is new. Should it be ‘cc’? If they are different, how are ‘cc’ and ‘c’ related?
The fmincon function can do that (I’ve not done it myself), but we need to know what your F function is and what you want to do with it (please describe) so we can be sure we can write the constraint function correctly.
There may be a typo in your post. The additive constant (0.5)^k doesn't affect the solution in any way. cc=argmin(F) is a solution for all k. Perhaps you really meant to write an equality,
If so, the first step is to minimize F() as I think you have done in other posts. If Fmin is this minimum, then the above reduces to
You could indeed use fminsearch to solve this nonlinear equality
cc=fminsearch(@(cc) abs(Fmin+(0.5)^k -F(cc)) ,...)
However, it would be more direct to use fzero
cc = fzero(@(cc) Fmin+(0.5)^k -F(cc) ,...)