Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: counting mouse clicks
Date: Mon, 27 Oct 2008 22:55:04 +0000 (UTC)
Organization: Harvard University
Lines: 21
Message-ID: <ge5gs8$2m5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1225148104 2757 172.30.248.37 (27 Oct 2008 22:55:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 27 Oct 2008 22:55:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1398872
Xref: news.mathworks.com comp.soft-sys.matlab:497549


Hi,

I want to get the number of clicks I made in a plot by using the buttondownfcn callback, but I don't know how to implement the count variable back to the main function:

function mousecount
 
count=0;
axes('buttondownfcn',{@click,count});
 
 
    function click(gcbo,eventdata,count)
 
    count=count+1;
    disp(count);

...?

Thanks for the help,

Julien