Hi there! I'm trying to get a while-loop to exit depending on two variables; one of them is changed when a time is passed (using a timer). The other one is changed inside the while loop after a condition. All this while loop is also inside a for a loop.
Here is a draft of my code:
x = false;
timer_ event = false;
timer_1 = timer('StartDelay', time_limit, 'TimerFcn', 'timer_event = true');
while((x == false) && (timer_event == false))
x = true;
The question here is that the while-loop only breaks when the x variable changes the value, but nothing happens when the timer callback changes the value of the timer_event variable.
Thank you so much!