Path: news.mathworks.com!not-for-mail
From: "Milind" <melindmm@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: How to return a variable from a callback function
Date: Fri, 14 Aug 2009 01:27:01 +0000 (UTC)
Organization: Oklahoma State University
Lines: 10
Message-ID: <h62eh5$f84$1@fred.mathworks.com>
Reply-To: "Milind" <melindmm@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250213221 15620 172.30.248.37 (14 Aug 2009 01:27:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 14 Aug 2009 01:27:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 809996
Xref: news.mathworks.com comp.soft-sys.matlab:563290


Hello, I've a timer object which calls the specified timer function, now my question is how can I return a variable from the callback function. Below is the code:

a=timer;
set(a,'ExecutionMode','fixedRate');
set(a,'Period',0.001);
a.timerFcn ={'Get3Chan',s,m}

start(a);

So, here it calls the function 'Get3Chan'. Now,I want to return a variable from 'Get3Chan' to the main code. How to do this?