Problem with while loop
1 回表示 (過去 30 日間)
古いコメントを表示
Kallam Haranadha Reddy
2017 年 10 月 19 日
コメント済み: Kallam Haranadha Reddy
2017 年 10 月 19 日
I wrote 3 functions and i wanted to link them in main function. In the main function i wrote a while loop . i am facing problem with this while loop. . The loop is running with initial values, i.e., it is not updating the values of rcapa, capaPAMin, and Bineq. The main function runs as follows
How to correct this problem.
global Bineq1; capaPAMin = inf; Bineq2 = capaPAMin; Bineq = vertcat(Bineq1,Bineq2); iter = 1; while(iter <=15) DA2 = @(Bineq,capaPAMin) somefunction(c1,c2,c3,c4,c8,capaPAMin,Aineq,Bineq,Aeq,Beq,lb2,ub2); [yd2,DAC2] = DA2(Bineq,capaPAMin); td2 = yd2(1345:1728); -- -- -- rcapa -- -- PA2 = @(rcapa) somotherfunction(c5,c6,c7,Aineq,Bineq,Aeq,rcapa,lb1,ub1); [yp2,PAC2] = PA2(rcapa); b = yp2(385:576); -- -- capaPA -- -- if capaPAMin > capaPA capaPAMin = capaPA; end Bineq2 = capaPAMin; Bineq = vertcat(Bineq1,Bineq2); iter = iter + 1; end
2 件のコメント
KL
2017 年 10 月 19 日
Please format your code. To do that, select the code in your question, click the {} Code button. That way, it is much easier to read.
採用された回答
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!