From: John on
% Hi!

% I open up my GUI and get the following error:

??? Error using ==> feval
Undefined function or method 'figure1_CreateFcn' for input arguments of type 'double'.

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> DataGrabber_GUI at 42
gui_mainfcn(gui_State, varargin{:});

Error in ==> guidemfile>@(hObject,eventdata)DataGrabber_GUI('figure1_CreateFcn',hObject,eventdata,guidata(hObject))


??? Error using ==> struct2handle
Error while evaluating figure CreateFcn

% Any idea why this is happening and how to fix it?

Thanks,

JF
From: Paul on
"John " <jfishbac(a)gmail.com> wrote in message <i1euhh$sgj$1(a)fred.mathworks.com>...
> % Hi!
>
> % I open up my GUI and get the following error:
>
> ??? Error using ==> feval
> Undefined function or method 'figure1_CreateFcn' for input arguments of type 'double'.
>
> Error in ==> gui_mainfcn at 96
> feval(varargin{:});
>
> Error in ==> DataGrabber_GUI at 42
> gui_mainfcn(gui_State, varargin{:});
>
> Error in ==> guidemfile>@(hObject,eventdata)DataGrabber_GUI('figure1_CreateFcn',hObject,eventdata,guidata(hObject))
>
>
> ??? Error using ==> struct2handle
> Error while evaluating figure CreateFcn
>
> % Any idea why this is happening and how to fix it?
>
> Thanks,
>
> JF

This happens when the matlab cannot find the control (button, axes, radio button, label and so on) in the .fig file which has a function assigned in the .m file.

If it is a figure, it is very probably that you change the name of the entire figure (main GUI window). Check the names and try to rename them in the right way.
From: John on
"Paul " <paul_tutzu(a)yahoo.com> wrote in message <i1evhv$4m2$1(a)fred.mathworks.com>...
> "John " <jfishbac(a)gmail.com> wrote in message <i1euhh$sgj$1(a)fred.mathworks.com>...
> > % Hi!
> >
> > % I open up my GUI and get the following error:
> >
> > ??? Error using ==> feval
> > Undefined function or method 'figure1_CreateFcn' for input arguments of type 'double'.
> >
> > Error in ==> gui_mainfcn at 96
> > feval(varargin{:});
> >
> > Error in ==> DataGrabber_GUI at 42
> > gui_mainfcn(gui_State, varargin{:});
> >
> > Error in ==> guidemfile>@(hObject,eventdata)DataGrabber_GUI('figure1_CreateFcn',hObject,eventdata,guidata(hObject))
> >
> >
> > ??? Error using ==> struct2handle
> > Error while evaluating figure CreateFcn
> >
> > % Any idea why this is happening and how to fix it?
> >
> > Thanks,
> >
> > JF
>
> This happens when the matlab cannot find the control (button, axes, radio button, label and so on) in the .fig file which has a function assigned in the .m file.
>
> If it is a figure, it is very probably that you change the name of the entire figure (main GUI window). Check the names and try to rename them in the right way.

I looked through my file for any phantom controls (both visually and by using the Object Browser) and have not found anything I'm not expecting. The only things that don't have code are the uipanels. I did, however, delete some controls from my GUI recently and I'm pretty sure I was careful to delete the callbacks for all of these controls (it was after I deleted these controls that I started to see this error). Did I not dig far enough when deleting the callbacks?

Thanks,

JF
From: Paul on
"John " <jfishbac(a)gmail.com> wrote in message <i1f1ol$qj5$1(a)fred.mathworks.com>...
> "Paul " <paul_tutzu(a)yahoo.com> wrote in message <i1evhv$4m2$1(a)fred.mathworks.com>...
> > "John " <jfishbac(a)gmail.com> wrote in message <i1euhh$sgj$1(a)fred.mathworks.com>...
> > > % Hi!
> > >
> > > % I open up my GUI and get the following error:
> > >
> > > ??? Error using ==> feval
> > > Undefined function or method 'figure1_CreateFcn' for input arguments of type 'double'.
> > >
> > > Error in ==> gui_mainfcn at 96
> > > feval(varargin{:});
> > >
> > > Error in ==> DataGrabber_GUI at 42
> > > gui_mainfcn(gui_State, varargin{:});
> > >
> > > Error in ==> guidemfile>@(hObject,eventdata)DataGrabber_GUI('figure1_CreateFcn',hObject,eventdata,guidata(hObject))
> > >
> > >
> > > ??? Error using ==> struct2handle
> > > Error while evaluating figure CreateFcn
> > >
> > > % Any idea why this is happening and how to fix it?
> > >
> > > Thanks,
> > >
> > > JF
> >
> > This happens when the matlab cannot find the control (button, axes, radio button, label and so on) in the .fig file which has a function assigned in the .m file.
> >
> > If it is a figure, it is very probably that you change the name of the entire figure (main GUI window). Check the names and try to rename them in the right way.
>
> I looked through my file for any phantom controls (both visually and by using the Object Browser) and have not found anything I'm not expecting. The only things that don't have code are the uipanels. I did, however, delete some controls from my GUI recently and I'm pretty sure I was careful to delete the callbacks for all of these controls (it was after I deleted these controls that I started to see this error). Did I not dig far enough when deleting the callbacks?
>
> Thanks,
>
> JF

I think I got it.

The figure1 is the default tag for the GUI. You created the GUI window, created a CreateFcn function for the GUI when the tag of the window was figure1. After that you changed the name of the tag.

So, go in the main GUI window, right-click, click on Property Inspector, search in the list for Tag and I can bet that the name is not 'figure1' anymore. You have more choices: change the name of the function to fit for the new Tag or delete the function if it contains no code (it will be automatically generated with the right name if you will ever need it in the future).

Let me know if this was useful.

Paul

So click on the
From: Walter Roberson on
John wrote:
> "Paul " <paul_tutzu(a)yahoo.com> wrote in message
> <i1evhv$4m2$1(a)fred.mathworks.com>...
>> "John " <jfishbac(a)gmail.com> wrote in message
>> <i1euhh$sgj$1(a)fred.mathworks.com>...

>> > > % I open up my GUI and get the following error:
>> > > ??? Error using ==> feval
>> > Undefined function or method 'figure1_CreateFcn' for input arguments
>> of type 'double'.

>> This happens when the matlab cannot find the control (button, axes,
>> radio button, label and so on) in the .fig file which has a function
>> assigned in the .m file.

> I looked through my file for any phantom controls (both visually and by
> using the Object Browser) and have not found anything I'm not expecting.

The error can also occur if you open the fig file directly instead of
opening the .m file for the GUI.

> Did I not dig far enough when deleting the callbacks?

Possibly.