First of all, I am really new to MATLAB so I'm not sure how to create multiple concurrent conditions for executing a while loop. I have a1(i)x + a2(i)y ≤ b(i) for i = 1, . . ., 16 and when this statement is true, it will execute, for example x=x+1. I have tried to code for that idea:
while (for i=i:16
a1(i)*x + a2(i)*y < b(i);
end)
x=x+1;
end
But of course, that code is wrong, I just want to make the whole for loop as the condition of the while loop. So how can I fix my code to do that? Thank you!
while x<3; for ii=1:3; a(ii) = ii;end;x=x+1;endworks fine.while true; for ii = 1:16 (...); if <condition>; break;end;end;x=x+1;end; take a look at the documentation page ofbreak.