callback code for push_button in matlab GUI to stop fast iterations due to FOR loops in main program
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Keshav Dev Singh
el 10 de Mzo. de 2014
Comentada: Keshav Dev Singh
el 11 de Mzo. de 2014
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
0 comentarios
Respuesta aceptada
Dishant Arora
el 10 de Mzo. de 2014
Editada: Dishant Arora
el 10 de Mzo. de 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 comentarios
Dishant Arora
el 11 de Mzo. de 2014
call that script file by name inside your run pushbutton callback.
Más respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!