Optimization through iteration - help!
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Geoff Hayes
2015년 5월 8일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Third-Party Cluster Configuration에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!