From: Robert Shirley on
I am trying to make a GUI that uses a FFBP network that I created. Whenever I run the GUI, it gives me a message '??? Undefined function or variable 'FFBP'. Of course everything beyond that is also an error. The network, which I called FFBP, is in my workspace and current directory. Can someone please tell me what I have to do to get the GUI to recognize my network. Thank you
From: Steven Lord on

"Robert Shirley" <robertmarkshirley(a)yahoo.com> wrote in message
news:hmet66$mjb$1(a)fred.mathworks.com...
>I am trying to make a GUI that uses a FFBP network that I created. Whenever
>I run the GUI, it gives me a message '??? Undefined function or variable
>'FFBP'. Of course everything beyond that is also an error. The network,
>which I called FFBP, is in my workspace and current directory. Can someone
>please tell me what I have to do to get the GUI to recognize my network.
>Thank you

You need to clarify what you mean by "is in my workspace and current
directory". Is FFBP a variable, a file with the extension .m, or both?

Like all functions, GUI callback functions generally operate in their own
workspace that is distinct from the base workspace (the workspace in which
the command line operates.) Thus if FFBP is a variable in the base
workspace, the callback functions cannot "see" it. You would need to get
the variable into the function workspace somehow (either by passing it in as
an input argument, or by storing it as a property of one of the GUI's
components from which you can retrieve it inside the function, etc.)

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


From: Robert Shirley on
Thank you for your response. FFBP was a neural network. I gather networks are treated differently from variables or other functions. I did not recognize GUI's operate with its own workspace. When I understood this, then I found the 'load' function which was able to bring my 'FFBP' function into the GUI's workspace. Thank you again.

Regards,
Robert Shirley


"Steven Lord" <slord(a)mathworks.com> wrote in message <hmfcvh$4ns$1(a)fred.mathworks.com>...
>
> "Robert Shirley" <robertmarkshirley(a)yahoo.com> wrote in message
> news:hmet66$mjb$1(a)fred.mathworks.com...
> >I am trying to make a GUI that uses a FFBP network that I created. Whenever
> >I run the GUI, it gives me a message '??? Undefined function or variable
> >'FFBP'. Of course everything beyond that is also an error. The network,
> >which I called FFBP, is in my workspace and current directory. Can someone
> >please tell me what I have to do to get the GUI to recognize my network.
> >Thank you
>
> You need to clarify what you mean by "is in my workspace and current
> directory". Is FFBP a variable, a file with the extension .m, or both?
>
> Like all functions, GUI callback functions generally operate in their own
> workspace that is distinct from the base workspace (the workspace in which
> the command line operates.) Thus if FFBP is a variable in the base
> workspace, the callback functions cannot "see" it. You would need to get
> the variable into the function workspace somehow (either by passing it in as
> an input argument, or by storing it as a property of one of the GUI's
> components from which you can retrieve it inside the function, etc.)
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>