Error while using a GUI
1 view (last 30 days)
Show older comments
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.
Accepted Answer
Luna
on 17 May 2019
Hi Tamir,
Just change line 116 as follows, definetely it will work:
[pathstr,name,ext]=fileparts(fullfile(pathname,file1));
0 Comments
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!