How I can check the button if enabled or disabled in MATLAB?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I wanna use if condition to check if the button is Enable or Disable can I do that ?
0 comentarios
Respuestas (2)
Jan
el 7 de Dic. de 2017
Editada: Jan
el 9 de Dic. de 2017
Actually the question is far too lean to be answered reliably. But a guess:
if handles.Checkbox1.Value
This is sufficient already, when I assume, that handles.Checkbox1 is the handle of your checkbox. Examine the tag of the checkbox or the handles struct to find the real name in your code.
[EDITED] The solution with R2015b and teh property "Enable" is:
if strcmp(handles.Button1.Enable, 'off')
If you handles.msg is a uint8, it is not a valid button handle.
11 comentarios
Jan
el 10 de Dic. de 2017
@Eliza: Why do you post the properties? Note, that this is a contradiction to what you have posted before:
class(handles.msg)
ans =
uint8
Please try to find out, why your handles.msg is sometimes an UINT8 and sometimes a graphics handle. Perhaps you overwrite it anywhere? But if it is a graphics handle, my suggestion should work directly. Did you try it?
Walter Roberson
el 10 de Dic. de 2017
At some point in your code, you are overwriting handles.msg with a uint8 array. Search your code for assignments to handles.msg
0 comentarios
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!