Effacer les filtres
Effacer les filtres

Issue with push button userdata

7 vues (au cours des 30 derniers jours)
Jason
Jason le 27 Sep 2019
Commenté : Himanshu Jain le 24 Août 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 commentaire
Himanshu Jain
Himanshu Jain le 24 Août 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Graphics Object Programming 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