Effacer les filtres
Effacer les filtres

callback code for push_button in matlab GUI to stop fast iterations due to FOR loops in main program

1 vue (au cours des 30 derniers jours)
I want to interrupt or break the program iterations (due to FOR loops in main program) in a GUI using a push_button. Can any one give me the precise pushbutton_callback code for the same. Your help will be greatly appreciated.
Thanks, K.D.Singh

Réponse acceptée

Dishant Arora
Dishant Arora le 10 Mar 2014
Modifié(e) : Dishant Arora le 10 Mar 2014
function pushbutton_callback(hObject, eventdata, handles)
setappdata(0 , 'Flag', 0);
while your other script might be like this
setappdata(0 , 'Flag' , 1);
while(1)
sprintf('in loop')
Flag=getappdata(0,'Flag');
if Flag == 0
break;
end
drawnow
end
  9 commentaires
Dishant Arora
Dishant Arora le 11 Mar 2014
call that script file by name inside your run pushbutton callback.
Keshav Dev Singh
Keshav Dev Singh le 11 Mar 2014
Thanks Dishant, I want to make a display button in my matlab GUI who can automatically show the running FOR loop iterations/ counts just like it shows in matlab workspace during programming running. e.g. 1,2,3...........200,....400....1000.....n-iterations
How to make such type of GUI DISPLAY window and what could be the script of this DISPLAY callback function?
Thank you very much in advance!
-- K.D.Singh

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by