From: SAHIN <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Output from Callback functions ?
Date: Tue, 25 May 2010 05:29:39 -0700 (PDT)
Lines: 43
Message-ID: <>
References: <htg2s7$j2f$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1274790580 26547 (25 May 2010 12:29:40 GMT)
NNTP-Posting-Date: Tue, 25 May 2010 12:29:40 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) 
	AppleWebKit/532.5 (KHTML, like Gecko) Chrome/ 
Xref: comp.soft-sys.matlab:639046


I am guessing that, you are using GUIDE and having problem in basic
argument passing.
If that is the case, you can output your structure inside handles.
handles = func_name(hObject,eventdata,handles)
Be aware of the fact that you have to save the handles structure where
you like it by using the below matlab function.
guidata(hObject, handles).

If you like to update a value within a callback scope you can use
nested functions.
Any variable you defined at the outher function will be updated by the
nested functions.
Or try using global variables.

If you explain us, how you use your callbacks, it would be easier to
suggest a solution.


On May 25, 10:48 am, "Talha " <> wrote:
> Hi,
> I'm a fresh MATLAB user and got stuck with a relatively simple problem.As there is no pointer support(as far as I know), I'm having problems with basic argument passing issues.I decided to post a message over here after no progress for one week.
> We are trying to get data from serial port and draw it on a plot.I used the callback functions of serial object.Until here there is no problem at all.But when it comes to get an output from callback or to update an array in the main,I couldn't find a way to do it.
> The question is:
> How can we output from a callback function? How can we update a value outside of the function within a callback scope?
> Any help will be highly appreciated.