Problem with while loop
1 view (last 30 days)
Show older comments
Kallam Haranadha Reddy
on 19 Oct 2017
Commented: Kallam Haranadha Reddy
on 19 Oct 2017
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 Comments
KL
on 19 Oct 2017
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.
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Interpolation 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!