Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!z33g2000vbb.googlegroups.com!not-for-mail
From: SAHIN <sahinaktas@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Output from Callback functions ?
Date: Tue, 25 May 2010 05:29:39 -0700 (PDT)
Organization: http://groups.google.com
Lines: 43
Message-ID: <3729ad8a-ee56-4a97-b6c1-acfcb0c2a8f8@z33g2000vbb.googlegroups.com>
References: <htg2s7$j2f$1@fred.mathworks.com>
NNTP-Posting-Host: 77.11.54.220
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1274790580 26547 127.0.0.1 (25 May 2010 12:29:40 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 25 May 2010 12:29:40 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z33g2000vbb.googlegroups.com; posting-host=77.11.54.220; 
	posting-account=ImBUSAoAAADTMCpSU0XNeuGsZbRiW1GO
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/4.1.249.1064 
	Safari/532.5,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:639046

Hi,

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.

Sahin AKTAS



On May 25, 10:48 am, "Talha " <ta...@talhakoc.com> 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.