Error while using a GUI

조회 수: 3 (최근 30일)
Tamir Eisenstein
Tamir Eisenstein 2019년 5월 17일
답변: Luna 2019년 5월 17일
Hi MATLAB experts,
I've been getting these errors notifications when trying using a toolbox GUI (the m.file is attached):
>> MCMxxxVI_RGBExplorer
Undefined function or variable 'file'.
Error in MCMxxxVI_RGBExplorer>pushbutton1_Callback (line 116)
[pathstr,name,ext]=fileparts(fullfile(pathname,file));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in MCMxxxVI_RGBExplorer (line 64)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)MCMxxxVI_RGBExplorer('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Would very appreciate any advice,
Tamir
EDIT: Tamir'S "Answer" moved here:
Hi Luna,
The files are attached,
these are the error notifications:
>> MCMxxxVI_RGBExplorer
Undefined function or variable 'file'.
Error in MCMxxxVI_RGBExplorer>pushbutton1_Callback (line 116)
[pathstr,name,ext]=fileparts(fullfile(pathname,file));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in MCMxxxVI_RGBExplorer (line 64)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)MCMxxxVI_RGBExplorer('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Error using fileparts
Too many output arguments.
Error in MCMxxxVI_RGBExplorer>pushbutton2_Callback (line 130)
[pathstr,name,~,~]=fileparts(fullfile(pathname,file2));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in MCMxxxVI_RGBExplorer (line 64)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)MCMxxxVI_RGBExplorer('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Error using fileparts
Too many output arguments.
Error in MCMxxxVI_RGBExplorer>pushbutton5_Callback (line 387)
[pathstr,name,ext,versn]=fileparts(get(handles.edit1,'String'));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in MCMxxxVI_RGBExplorer (line 64)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)MCMxxxVI_RGBExplorer('pushbutton5_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
  댓글 수: 2
Luna
Luna 2019년 5월 17일
MCMxxxVI_RGBExplorer.fig does not exist. Please share all necessary files to run the GUI and reproduce your error again.
Dennis
Dennis 2019년 5월 17일
There is no variable 'file' in your callback. However there is a variable 'file1'.

댓글을 달려면 로그인하십시오.

채택된 답변

Luna
Luna 2019년 5월 17일
Hi Tamir,
Just change line 116 as follows, definetely it will work:
[pathstr,name,ext]=fileparts(fullfile(pathname,file1));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by