<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Advanced MATLAB: Capture mouse movement</title>
	<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/</link>
	<description>&#60;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=969735&#38;objectType=author"&#62;Bob&#60;/a&#62;, &#60;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1093599&#38;objectType=author"&#62;Brett&#60;/a&#62; &#38; &#60;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1094142&#38;objectType=author"&#62;Jiro&#60;/a&#62; share favorite user-contributed submissions from the File Exchange.</description>
	<pubDate>Mon, 23 Nov 2009 00:05:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-13276</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Wed, 21 Oct 2009 14:07:25 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-13276</guid>
		<description>@Lucy

I think this is what you seek to move a line with the mouse in MATLAB.

http://blogs.mathworks.com/videos/2008/05/27/advanced-matlab-capture-mouse-movement/

Doug</description>
		<content:encoded><![CDATA[<p>@Lucy</p>
<p>I think this is what you seek to move a line with the mouse in MATLAB.</p>
<p><a href="http://blogs.mathworks.com/videos/2008/05/27/advanced-matlab-capture-mouse-movement/" rel="nofollow">http://blogs.mathworks.com/videos/2008/05/27/advanced-matlab-capture-mouse-movement/</a></p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucy</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-13275</link>
		<dc:creator>Lucy</dc:creator>
		<pubDate>Mon, 19 Oct 2009 21:07:37 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-13275</guid>
		<description>Dear Doug,

I’m a Matlab newbie and I think your videos are fantastic – without them I would be lost!   

A question: I have created a simple GUI where data can be plotted and where coordinates can be obtained by pointing and clicking the mouse on the figure. However, I’m looking to obtain the coordinates from a figure in a more dynamic way.  What I would like to be able to do is create a moving point which is fixed to the trajectory of the plot, which I drag up and down the line and obtain the plot coordinates - Yahoo interactive finance graphs have something similar. Is this possible in Matlab, and if so, could you give me any hints on what I would need to do to achieve this?  

Any suggestions would be very much appreciated!!

Lucy</description>
		<content:encoded><![CDATA[<p>Dear Doug,</p>
<p>I’m a Matlab newbie and I think your videos are fantastic – without them I would be lost!   </p>
<p>A question: I have created a simple GUI where data can be plotted and where coordinates can be obtained by pointing and clicking the mouse on the figure. However, I’m looking to obtain the coordinates from a figure in a more dynamic way.  What I would like to be able to do is create a moving point which is fixed to the trajectory of the plot, which I drag up and down the line and obtain the plot coordinates - Yahoo interactive finance graphs have something similar. Is this possible in Matlab, and if so, could you give me any hints on what I would need to do to achieve this?  </p>
<p>Any suggestions would be very much appreciated!!</p>
<p>Lucy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12964</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Wed, 17 Dec 2008 18:29:45 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12964</guid>
		<description>@Aswath,

If one subfunction has an end statement, then they all must have one.  That will help with the code pasting problem.

As for handles structure:

http://blogs.mathworks.com/videos/2008/04/17/advanced-matlab-handles-and-other-inputs-to-guide-callbacks/

-Doug</description>
		<content:encoded><![CDATA[<p>@Aswath,</p>
<p>If one subfunction has an end statement, then they all must have one.  That will help with the code pasting problem.</p>
<p>As for handles structure:</p>
<p><a href="http://blogs.mathworks.com/videos/2008/04/17/advanced-matlab-handles-and-other-inputs-to-guide-callbacks/" rel="nofollow">http://blogs.mathworks.com/videos/2008/04/17/advanced-matlab-handles-and-other-inputs-to-guide-callbacks/</a></p>
<p>-Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aswath</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12963</link>
		<dc:creator>Aswath</dc:creator>
		<pubDate>Wed, 17 Dec 2008 13:50:14 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12963</guid>
		<description>Hi! 
I've not been able to get the functions to work in a GUI. 
I am getting errors if I paste the code into my code, since other GUI functions dont have an 'end' statement.
I would also like to know how to pass handles of objects inside the GUI to functions outside...</description>
		<content:encoded><![CDATA[<p>Hi!<br />
I&#8217;ve not been able to get the functions to work in a GUI.<br />
I am getting errors if I paste the code into my code, since other GUI functions dont have an &#8216;end&#8217; statement.<br />
I would also like to know how to pass handles of objects inside the GUI to functions outside&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Everest</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12212</link>
		<dc:creator>Everest</dc:creator>
		<pubDate>Thu, 24 Jul 2008 13:18:57 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12212</guid>
		<description>Thanks Doug!

The problem is solved now.. Actually I've used UserData property to gave the name to  my 'figure',axis' and 'line' so I could call them in the external function (draggingFcn etc.)  
However, it was not so obvious at the beginning. 

Everest</description>
		<content:encoded><![CDATA[<p>Thanks Doug!</p>
<p>The problem is solved now.. Actually I&#8217;ve used UserData property to gave the name to  my &#8216;figure&#8217;,axis&#8217; and &#8216;line&#8217; so I could call them in the external function (draggingFcn etc.)<br />
However, it was not so obvious at the beginning. </p>
<p>Everest</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12156</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Fri, 18 Jul 2008 17:45:33 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12156</guid>
		<description>Everest,

I just did a quick check.  That version of MATLAB is about three years ago. There have been enough changes in function handles that I suspect that is the reason code written for the newer version of MATLAB does not work in an older version.

Doug</description>
		<content:encoded><![CDATA[<p>Everest,</p>
<p>I just did a quick check.  That version of MATLAB is about three years ago. There have been enough changes in function handles that I suspect that is the reason code written for the newer version of MATLAB does not work in an older version.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Everest</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12145</link>
		<dc:creator>Everest</dc:creator>
		<pubDate>Thu, 17 Jul 2008 08:30:57 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-12145</guid>
		<description>Hi!
This is really great!:] I've used this idea to move the data points on my plot. But here is my query:
the code works really great on Matlab 7.1, but when I run it on the older version (actually it is Matlab 6.1.0.450)
I get the following error:

********************************************************
??? Undefined function or variable 'f'.

Error in ==&#62; G:\MATLAB_61\MOUSE_CAPTURE\mouse_capt.m (startDragFcn)
On line 66  ==&#62;         set(f,'WindowButtonMotionFcn',@draggingFcn)

??? Error while evaluating line ButtonDownFcn.

??? Undefined function or variable 'f'.

Error in ==&#62; G:\MATLAB_61\MOUSE_CAPTURE\mouse_capt.m (stopDragFcn)
On line 128  ==&#62;         set(f, 'WindowButtonMotionFcn','')

??? Error while evaluating figure WindowButtonUpFcn.
********************************************************

Why is that? What to do to make it work on the older version?</description>
		<content:encoded><![CDATA[<p>Hi!<br />
This is really great!:] I&#8217;ve used this idea to move the data points on my plot. But here is my query:<br />
the code works really great on Matlab 7.1, but when I run it on the older version (actually it is Matlab 6.1.0.450)<br />
I get the following error:</p>
<p>********************************************************<br />
??? Undefined function or variable &#8216;f&#8217;.</p>
<p>Error in ==&gt; G:\MATLAB_61\MOUSE_CAPTURE\mouse_capt.m (startDragFcn)<br />
On line 66  ==&gt;         set(f,&#8217;WindowButtonMotionFcn&#8217;,@draggingFcn)</p>
<p>??? Error while evaluating line ButtonDownFcn.</p>
<p>??? Undefined function or variable &#8216;f&#8217;.</p>
<p>Error in ==&gt; G:\MATLAB_61\MOUSE_CAPTURE\mouse_capt.m (stopDragFcn)<br />
On line 128  ==&gt;         set(f, &#8216;WindowButtonMotionFcn&#8217;,&#8221;)</p>
<p>??? Error while evaluating figure WindowButtonUpFcn.<br />
********************************************************</p>
<p>Why is that? What to do to make it work on the older version?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tahim</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11981</link>
		<dc:creator>Tahim</dc:creator>
		<pubDate>Tue, 01 Jul 2008 22:56:16 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11981</guid>
		<description>I was looking for an answer for this problem in matlab web page and I found the solution. When using the functions presented by the Doug (nice work Doug) all you have to do to use them inside your GUIs is to pass the handles of the GUI inside a cell.

When using additional arguments for the callback function, you must set the value of the property to a cell array (i.e., enclose the function handle and arguments in curly braces). For example,
You can define the callback function to accept additional input arguments by adding them to the function definition. For example,

function startDragFcn(src,eventdata,arg1)

arg1 is an additional argument. In my case I used the handles of the GUI as an additional argument:

function startDragFcn(hObject,eventdata,handles)

So, for the callback function you have to enclose the function handle and the additional arguments in curly braces. For example,

set(hLine,'ButtonDownFcn',{@startDragFcn,handles});
set(hFigure, 'WindowButtonUpFcn',{@stopDragFcn,handles});</description>
		<content:encoded><![CDATA[<p>I was looking for an answer for this problem in matlab web page and I found the solution. When using the functions presented by the Doug (nice work Doug) all you have to do to use them inside your GUIs is to pass the handles of the GUI inside a cell.</p>
<p>When using additional arguments for the callback function, you must set the value of the property to a cell array (i.e., enclose the function handle and arguments in curly braces). For example,<br />
You can define the callback function to accept additional input arguments by adding them to the function definition. For example,</p>
<p>function startDragFcn(src,eventdata,arg1)</p>
<p>arg1 is an additional argument. In my case I used the handles of the GUI as an additional argument:</p>
<p>function startDragFcn(hObject,eventdata,handles)</p>
<p>So, for the callback function you have to enclose the function handle and the additional arguments in curly braces. For example,</p>
<p>set(hLine,&#8217;ButtonDownFcn&#8217;,{@startDragFcn,handles});<br />
set(hFigure, &#8216;WindowButtonUpFcn&#8217;,{@stopDragFcn,handles});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tahim</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11980</link>
		<dc:creator>Tahim</dc:creator>
		<pubDate>Tue, 01 Jul 2008 21:44:14 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11980</guid>
		<description>I have a similar problem as Vincent. I tried to use these functions inside my GUI, although I think these created functions can't see the handles of the GUI.
My startDragFcn is written basically the same way as Vincent:

startDragFcn(hObject, eventdata, handles)
%Inside this function handles is not availabel and I need the axes that is stored in the handles.

When I click over the line I get ??? Input argument “handles” is undefined.</description>
		<content:encoded><![CDATA[<p>I have a similar problem as Vincent. I tried to use these functions inside my GUI, although I think these created functions can&#8217;t see the handles of the GUI.<br />
My startDragFcn is written basically the same way as Vincent:</p>
<p>startDragFcn(hObject, eventdata, handles)<br />
%Inside this function handles is not availabel and I need the axes that is stored in the handles.</p>
<p>When I click over the line I get ??? Input argument “handles” is undefined.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Lauber</title>
		<link>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11545</link>
		<dc:creator>Jan Lauber</dc:creator>
		<pubDate>Mon, 09 Jun 2008 13:43:30 +0000</pubDate>
		<guid>http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/#comment-11545</guid>
		<description>Very cool. Works great as an intereactive thresholding</description>
		<content:encoded><![CDATA[<p>Very cool. Works great as an intereactive thresholding</p>
]]></content:encoded>
	</item>
</channel>
</rss>
