From: Adam on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <htp8g7$26k$1(a)fred.mathworks.com>...
> Wherever the string is returned from uigetfile, save it using guidata or something similar. Then in your start button callback, access the string.
>
> % in menuitem callback
> STR = uigetfile(...)
> HC = guidata(gcbf);
> HC.STR = STR;
> guidata(gcbf,HC)
>
>
> % Now in your start button callback
> HC = guidata(gcbf)
> STR = HC.STR; % This is the string returned by gui

I think this is the correct approach. However I get an error when trying this saying.

??? Reference to non-existent field 'STR'.

Is defining HC.STR supposed to create a new field? Should I make an invisible one somehow?
From: Matt Fig on
Did you make sure that the one callback is called (the one which calls uigetfile) first before the start button callback? This works in a GUIDE GUI I created to test it. Of course if the callback order is wrong, then there will be no STR field.

One way to avoid this is to create the start button with the 'enable' property set to 'inactive'. Then once a file is chosen by the uimenu callback set the 'enable' property of the startbutton to 'on' when the STR field is added.
From: Steven Lord on

"Adam " <abc5(a)ubc.ca> wrote in message
news:htp9pi$mic$1(a)fred.mathworks.com...
> "Steven Lord" <slord(a)mathworks.com> wrote in message
> <htp9ic$95b$1(a)fred.mathworks.com>...

*snip*

> Good point, I may be missing an 'end' somewhere I'll check to make sure.

If you have this code open in the MATLAB Editor, look at the upper-right
corner. Is the square there green, orange, or red? If some but not all of
your functions end in END, it will be red and there will be a red line in
the gutter below it that when you hover the mouse over it should indicate
that there's a missing END.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Adam on
"Steven Lord" <slord(a)mathworks.com> wrote in message <htpau6$4dr$1(a)fred.mathworks.com>...
>
> "Adam " <abc5(a)ubc.ca> wrote in message
> news:htp9pi$mic$1(a)fred.mathworks.com...
> > "Steven Lord" <slord(a)mathworks.com> wrote in message
> > <htp9ic$95b$1(a)fred.mathworks.com>...
>
> *snip*
>
> > Good point, I may be missing an 'end' somewhere I'll check to make sure.
>
> If you have this code open in the MATLAB Editor, look at the upper-right
> corner. Is the square there green, orange, or red? If some but not all of
> your functions end in END, it will be red and there will be a red line in
> the gutter below it that when you hover the mouse over it should indicate
> that there's a missing END.
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
>
You guys have been awesome. It now works. It was actually a combination of both your suggestions that did the trick. I added 'end' to all my functions (including varargout) and the errors regarding the 'end's went away. Then I used Matt's method and voila. Thanks again. I'm sure I will have more questions soon.