How to execute multiple optimized values for x according to n, using fmincon
조회 수: 1(최근 30일)
Hello, kindly help me in finding n optimal values for x (x is a vector not single valued).
e.g. i have the main code
function Rsum Simple(x)
by using fmincon i am optimizing x
A = ;
b = ;
[x,fval]= fmincon(@(x) Simple(x),x0,A,b,,,lb,ub);
after executing first attempt i want to get 2 optimized values of x,in 2nd i need 4 optimized values and in 3rd time x=6, but i dont know how to execute it. can any body help me out to find multiple values of x(with respect to n).??
thank you in advance
Titus Edelhofer 2019년 5월 17일
편집: Titus Edelhofer 2019년 5월 17일
there are a couple of things I don't understand: you say "x is a vector"? But you always start with x0=initial_guess, which is a scalar. Perhaps this is the first change you would need to do:
x0 = repmat(initial_val, n, 1);
to make x0 a vector.
Second, your objective function is strange. Variable S is not used? x = [0...0] is the solution for the function you wrote.