Error while using a GUI

3 visualizaciones (últimos 30 días)
Tamir Eisenstein
Tamir Eisenstein el 17 de Mayo de 2019
Respondida: Luna el 17 de Mayo de 2019
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 comentarios
Luna
Luna el 17 de Mayo de 2019
MCMxxxVI_RGBExplorer.fig does not exist. Please share all necessary files to run the GUI and reproduce your error again.
Dennis
Dennis el 17 de Mayo de 2019
There is no variable 'file' in your callback. However there is a variable 'file1'.

Iniciar sesión para comentar.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by