Error while using a GUI

4 次查看(过去 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