GUI-Function inside the Radio button function
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdallah Shaltout
am 13 Feb. 2017
Kommentiert: Abdallah Shaltout
am 17 Mär. 2017
In GUI I created the attached function called BE_RE(X1,N1) and I would like to call it inside the radiobuttons. It gives me the following error:
??? Undefined variable "handles" or class "handles.axes1".
Error in ==> BE_RE at 37
PK1=plot(X1(:,1),X1(:,7),'-sc','LineWidth',2,'parent',handles.axes1) % McMaster
Error in ==> BE>radiobutton5_Callback at 124
BE_RE(num, Data_Nr)
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> BE at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==> guidemfile>@(hObject,eventdata)BE('radiobutton5_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
0 Kommentare
Akzeptierte Antwort
Jan
am 13 Feb. 2017
If the variable "handles" is not known inside this function, provide it as input:
function BE_RE(X1,N1, handles)
Now add the handles struct inside the calling function also, which is the radio button's callback:
function RadioCallback(hObject, EventData)
handles = guidata(hObject);
BE_RE(X1,N1, handles)
7 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!