Borrar filtros
Borrar filtros

Issue with push button userdata

7 visualizaciones (últimos 30 días)
Jason
Jason el 27 de Sept. de 2019
Comentada: Himanshu Jain el 24 de Ag. de 2021
Hello.
I am trying to enable a push button to exit a loop if its pressed and decided to user the buttons "UserData".
So I initially set it to 0.
set(handles.btnStop, 'userdata',0)
in my loop, i then check the status of this with an if statement
if get(handles.btnStop, 'userdata') % stop condition
break;
end
In a stop push button I set the user data to 1
set(handles.btnStop, 'userdata',1)
But Im getting a strange result.
when I check what the userdata is berfore I go into the loop (via set(handles.btnStop, 'userdata',0)), I see its a cell array with 2 elements:
ans =
2×1 cell array
{[0]}
{[0]}
  1 comentario
Himanshu Jain
Himanshu Jain el 24 de Ag. de 2021
I am not able to reproduce the same issue, I am getting the expected results. Can you please send more info about the issue. Also if possible, please share the code in which this issue is occuring.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by