Do something only, when variable is same for 2 second

1 view (last 30 days)
Hello guys,
how can I write a code (cycle) something like "when value is same for 2 second, do something else"? Example below, Im changing variable "a".
a = 1;
"if a = a (for more then 2 second, then ..)"
b = a;
Best regards
martin martin
martin martin on 25 Apr 2019
Thanks man, I solved it with "if" and "pause"
t1 = round(get(handles.slider1,'value'));
if t1 == round(get(handles.slider1,'value'))

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!