How do I solve the error: Undefined variable "handles" or class "handles.edit21"?
Ältere Kommentare anzeigen
I have developed a GUI.When the pushbuttton is clicked, the calculation is done and the calculated number which is stored in the variable 'T' must be displayed in an edit box as the output. I have used
set(handles.edit21,'String',T);
in the pushbutton callback. However when i click the pushbutton, I get the following error:
Undefined variable "handles" or class "handles.edit21".
How can I rectify this?
Antworten (3)
Muruganandham Subramanian
am 18 Dez. 2012
Bearbeitet: Muruganandham Subramanian
am 18 Dez. 2012
0 Stimmen
Variable 'T' should be converted to string using num2str(T) first, before calling. Have you done this?
1 Kommentar
Nitin Samuel
am 18 Dez. 2012
Jan
am 18 Dez. 2012
Whne the variable handles is unknown, you have to define it. This is actually trivial, so I'm not sure what the problem exactly is. A guess:
handles = guidata(hObject);
1 Kommentar
Nitin Samuel
am 18 Dez. 2012
Ilham Hardy
am 18 Dez. 2012
Did you use any clear -command family in your GUIDE code?
Such as:
clear
clearvars
clear all
1 Kommentar
Nitin Samuel
am 18 Dez. 2012
Bearbeitet: Nitin Samuel
am 18 Dez. 2012
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!