Optimization through iteration - help!
3 views (last 30 days)
Show older comments
I'm desperatley trying to optimize vector x such as its sum equals one.I need this for an optimization problem which can only be solved by iteration.. Thx for any adivce
best Jan
x = [0.125,0.125,0.125,0.125];
testf = sum(x);
test1 = 1;
while abs(test1-testf)~=0
test1 = testf;
testf = sum(x*2);
end
9 Comments
Geoff Hayes
on 8 May 2015
Jan - the code never resets the weight array so you will get the same answer on each iteration of the while loop. And multiplying the weights by a number less than one will mean that
sum(weight*0.2) < sum(weight)
always since each element of weight is less than one.
See Also
Categories
Find more on Third-Party Cluster Configuration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!