Hi, I am doing a GUI plotting, trying to implement a real-time plot. I use 'if' loop for different conditions with the pushbutton callback, but when 'if' loop is used, there is error and the other conditions will not execute. So, I use 'while' loop instead and it works. The problem is, when the 'while' loop is used, the command inside the 'while' loop cannot run normally as the conditions keep refreshing by the loop. Can anyone help me?
My function looks like this, inside a pushbutton callback:
while hObject.String=='Pause' % when 'if' is used here, the plot won't stop plotting
% at here I want to select and highlight data, since 'while' loop is running, the dragged plot will return to the 'while' loop place and the datatip unable to be selected.