How to end loop if value does not change for X consecutive seconds in Matlab
user392 Published in June 19, 2018, 4:15 pm
I am collecting data from a potentiometer connected to an Arduino. In the script, I tell matlab to keep collecting data for 2 minutes. But I need to tell it that if the user does not move the potentiometer for 10 consecutive seconds, then it should stop the loop and move to the next session (write the data to an excel file). Does anybody have ideas on how to achieve this?