<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments for Undocumented Matlab</title>
	<atom:link href="http://undocumentedmatlab.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://undocumentedmatlab.com</link>
	<description>Charting Matlab's unsupported hidden underbelly</description>
	<pubDate>Fri, 12 Mar 2010 16:41:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Setting desktop tab completions by Henrik Toft</title>
		<link>http://undocumentedmatlab.com/blog/setting-desktop-tab-completions/comment-page-1/#comment-8102</link>
		<dc:creator>Henrik Toft</dc:creator>
		<pubDate>Fri, 12 Mar 2010 09:22:19 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1175#comment-8102</guid>
		<description>A related question, which however is not tab completion, but presents informaiton is the same way:

When in the workspace I type e.g. "plot(" or "corrcoef(" and wait a second, I am presented with a context sensitive help showing a number of ways to use the "plot" or "corrcoef" functions. Where is this context sensitive help stored? I have tried to look at different functions to see how the help-section is written, and made a similar setup:

&lt;pre lang="matlab"&gt;
function testHelp(x,varargin)
% TESTHELP   See how context help is defined
%   TESTHELP(X)
%
%   TESTHELP(X,Y)
&lt;/pre&gt;

but it does not present me with a "similar" context sensitive help...

Cheers Henrik</description>
		<content:encoded><![CDATA[<p>A related question, which however is not tab completion, but presents informaiton is the same way:</p>
<p>When in the workspace I type e.g. &#8220;plot(&#8221; or &#8220;corrcoef(&#8221; and wait a second, I am presented with a context sensitive help showing a number of ways to use the &#8220;plot&#8221; or &#8220;corrcoef&#8221; functions. Where is this context sensitive help stored? I have tried to look at different functions to see how the help-section is written, and made a similar setup:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">function</span> testHelp<span style="color: #080;">&#40;</span>x,<span style="color: #0000FF;">varargin</span><span style="color: #080;">&#41;</span>
<span style="color: #228B22;">% TESTHELP   See how context help is defined</span>
<span style="color: #228B22;">%   TESTHELP(X)</span>
<span style="color: #228B22;">%</span>
<span style="color: #228B22;">%   TESTHELP(X,Y)</span></pre></div></div>

<p>but it does not present me with a &#8220;similar&#8221; context sensitive help&#8230;</p>
<p>Cheers Henrik</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8081</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Thu, 11 Mar 2010 16:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8081</guid>
		<description>@Varun - the reason I do not use &lt;b&gt;&lt;i&gt;verLessThan&lt;/i&gt;&lt;/b&gt; was explained &lt;a target="_blank" href="http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/comment-page-1/#comment-3436" rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Varun - the reason I do not use <b><i>verLessThan</i></b> was explained <a target="_blank" href="http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/comment-page-1/#comment-3436" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Varun</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8080</link>
		<dc:creator>Varun</dc:creator>
		<pubDate>Thu, 11 Mar 2010 16:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8080</guid>
		<description>Hello Yair,

You might already be aware of this and probably have a reason for not using it. :)

To check for version of MATLAB have you tried the &lt;b&gt;&lt;i&gt;verLessThan&lt;/i&gt;&lt;/b&gt; function?

&lt;pre lang="matlab"&gt;
if ~verLessThan('matlab','7.6')
    % Do something here that that works in newer version
else
    % Do something here that works in the older version
end
&lt;/pre&gt;

Regards .. Varun</description>
		<content:encoded><![CDATA[<p>Hello Yair,</p>
<p>You might already be aware of this and probably have a reason for not using it. <img src='http://undocumentedmatlab.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
To check for version of MATLAB have you tried the <b><i>verLessThan</i></b> function?</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">if</span> ~verLessThan<span style="color: #080;">&#40;</span><span style="color:#A020F0;">'matlab'</span>,<span style="color:#A020F0;">'7.6'</span><span style="color: #080;">&#41;</span>
    <span style="color: #228B22;">% Do something here that that works in newer version</span>
<span style="color: #0000FF;">else</span>
    <span style="color: #228B22;">% Do something here that works in the older version</span>
<span style="color: #0000FF;">end</span></pre></div></div>

<p>Regards .. Varun</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8079</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Thu, 11 Mar 2010 16:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8079</guid>
		<description>thanks Mark,

For any newly-created object, simply pass this object through &lt;b&gt;&lt;i&gt;javaObjectEDT&lt;/i&gt;&lt;/b&gt; once to save you the trouble of using &lt;b&gt;&lt;i&gt;javaMethodEDT&lt;/i&gt;&lt;/b&gt; on each of its subsequent method invocations. As Matt noted in the article, &lt;b&gt;&lt;i&gt;javaObjectEDT&lt;/i&gt;&lt;/b&gt;'s overhead is slight and its benefits far outweigh the negligible performance penalty (on R2008b+, that is...).

AFAIK, &lt;b&gt;&lt;i&gt;set&lt;/i&gt;&lt;/b&gt; does not automatically use EDT if the object was not auto-delegated using &lt;b&gt;&lt;i&gt;javaObjectEDT&lt;/i&gt;&lt;/b&gt;. Note to set the callback on &lt;i&gt;&lt;b&gt;handle&lt;/b&gt;(jObject,'CallbackProperties')&lt;/i&gt; rather than directly on the Java object &lt;i&gt;jObject&lt;/i&gt;, in order to prevent a &lt;a target=_blank" href="http://undocumentedmatlab.com/blog/uicontrol-callbacks/" rel="nofollow"&gt;memory leak&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>thanks Mark,</p>
<p>For any newly-created object, simply pass this object through <b><i>javaObjectEDT</i></b> once to save you the trouble of using <b><i>javaMethodEDT</i></b> on each of its subsequent method invocations. As Matt noted in the article, <b><i>javaObjectEDT</i></b>&#8217;s overhead is slight and its benefits far outweigh the negligible performance penalty (on R2008b+, that is&#8230;).</p>
<p>AFAIK, <b><i>set</i></b> does not automatically use EDT if the object was not auto-delegated using <b><i>javaObjectEDT</i></b>. Note to set the callback on <i><b>handle</b>(jObject,&#8217;CallbackProperties&#8217;)</i> rather than directly on the Java object <i>jObject</i>, in order to prevent a <a target=_blank" href="http://undocumentedmatlab.com/blog/uicontrol-callbacks/" rel="nofollow">memory leak</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Mark</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8078</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 11 Mar 2010 14:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8078</guid>
		<description>Hi Yair,

first thanks for all the code and insights you are sharing with us. I have to admit that you inspired me to use a lot of Java functionality in my GUIs. They are looking much better now;-) I was never much concerned with the threading problems in smaller GUIs. 

But now I've rewrote  a complete Matlab GUI with Java Swing and Netbeans and running into some serious threading trouble. With findjobj() I look for the java handles in Matlab and assign the existing Matlab functions as callbacks and change the elements content from Matlab. 

I'm not sure if I understood the usage of javaObjectEDT correctly. If I could use javaObjectEDT to create the GUI from MATLAB, there would be no problems, occuring in the subsequent calls to the objects methods. But each time the return value is a new object I have to use javaMethodEDT?

Another question: Does the Matlab set() function dispatch all its calls automatically to the EDT? Should it be used if possible to change properties?

Thanks a lot for your time and keep up the great work. I don't know what I would do without all your available examples and scripts.

Thanks a lot
 Mark</description>
		<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>first thanks for all the code and insights you are sharing with us. I have to admit that you inspired me to use a lot of Java functionality in my GUIs. They are looking much better now;-) I was never much concerned with the threading problems in smaller GUIs. </p>
<p>But now I&#8217;ve rewrote  a complete Matlab GUI with Java Swing and Netbeans and running into some serious threading trouble. With findjobj() I look for the java handles in Matlab and assign the existing Matlab functions as callbacks and change the elements content from Matlab. </p>
<p>I&#8217;m not sure if I understood the usage of javaObjectEDT correctly. If I could use javaObjectEDT to create the GUI from MATLAB, there would be no problems, occuring in the subsequent calls to the objects methods. But each time the return value is a new object I have to use javaMethodEDT?</p>
<p>Another question: Does the Matlab set() function dispatch all its calls automatically to the EDT? Should it be used if possible to change properties?</p>
<p>Thanks a lot for your time and keep up the great work. I don&#8217;t know what I would do without all your available examples and scripts.</p>
<p>Thanks a lot<br />
 Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8041</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Wed, 10 Mar 2010 23:00:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8041</guid>
		<description>@Petter - you are correct of course. The relevant section should be changed to:
&lt;pre lang="matlab"&gt;
verStr = regexprep(version,'(^\d\.\d+)\..*','$1');
if str2double(verStr) &gt; 7.6
   ...
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Petter - you are correct of course. The relevant section should be changed to:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;">verStr = regexprep<span style="color: #080;">&#40;</span><span style="color: #0000FF;">version</span>,<span style="color:#A020F0;">'(^\d\.\d+)\..*'</span>,<span style="color:#A020F0;">'$1'</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">if</span> <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>verStr<span style="color: #080;">&#41;</span> &gt; <span style="color: #33f;">7.6</span>
   <span style="color: #F0F;">...</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>Comment on Matlab and the Event Dispatch Thread (EDT) by Petter</title>
		<link>http://undocumentedmatlab.com/blog/matlab-and-the-event-dispatch-thread-edt/comment-page-1/#comment-8038</link>
		<dc:creator>Petter</dc:creator>
		<pubDate>Wed, 10 Mar 2010 22:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1198#comment-8038</guid>
		<description>Isn't the code
&lt;pre lang="matlab"&gt;
if str2double(v(1:3)) &gt; 7.6
   &lt;/pre&gt;
problematic on the upcoming version 7.10?</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t the code</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">if</span> <span style="color: #0000FF;">str2double</span><span style="color: #080;">&#40;</span>v<span style="color: #080;">&#40;</span><span style="color: #33f;">1</span><span style="color: #F0F;">:</span><span style="color: #33f;">3</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span> &gt; <span style="color: #33f;">7.6</span></pre></div></div>

<p>problematic on the upcoming version 7.10?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Solving a MATLAB bug by subclassing by Matt Whitaker</title>
		<link>http://undocumentedmatlab.com/blog/solving-a-matlab-bug-by-subclassing/comment-page-1/#comment-8005</link>
		<dc:creator>Matt Whitaker</dc:creator>
		<pubDate>Tue, 09 Mar 2010 19:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1110#comment-8005</guid>
		<description>Hi Foster,
This is another good situation for subclassing.
Here is a pretty minimal class for setting the vertex size. Note it does not handle the situation of adding a new vertex or changing vertex color after creation. For now you can just call the setVertexSize method after doing one of those operations. That's slightly more sophisticated and may be worth a complete blog entry.

&lt;pre lang="matlab"&gt;
classdef impoly_vertex &lt; impoly
    
    properties (GetAccess = public, SetAccess = private)
        vertexCrossSize;
        vertexDotSize;
    end %properties
    
    methods
        function obj =  impoly_vertex(crossSize,dotSize,varargin)
            if nargin &lt; 2
                error('impoly_vertex:InsufficientArguments','Both the cross and dot size must be passed as constructor arguments');
            end %if
            obj = obj@impoly(varargin{:});
            obj.parseSizeInputs(crossSize,dotSize);
            obj.setVertexSize;
        end %impoly_vertex
        
        function setVertexSize(obj)
            crossChildren = findobj(obj.h_group,'Type','line','Marker','+');
            dotChildren = findobj(obj.h_group,'Type','line','Marker','O');
            set(crossChildren,'MarkerSize',obj.vertexCrossSize);
            set(dotChildren,'MarkerSize',obj.vertexDotSize);
        end
        
        function setCrossSize(obj,cs)
            obj.parseSizeInputs(cs,obj.vertexDotSize);
            obj.setVertexSize;
        end %setCrossSize
        
        function setDotSize(obj,ds)
            obj.parseSizeInputs(obj.vertexCrossSize,ds);
            obj.setVertexSize;
        end %setCrossSize
    end
    
    methods (Access = protected)
        function parseSizeInputs(obj,cs,ds)
            validateattributes(cs,{'numeric'},{'scalar','nonnegative','real'});
            validateattributes(ds,{'numeric'},{'scalar','nonnegative','real'});
            obj.vertexCrossSize = cs;
            obj.vertexDotSize = ds;
        end %parseSizeInputs
    end %private Methods    
    
end %impoly_vertex
&lt;/pre&gt;

Here we let it draw the polygon then find the vertices and change the marker size of the lines that make them up. Usage as follows:

&lt;pre lang="matlab"&gt;
figure, imshow('gantrycrane.png');
%about half the regular vertex size
h = impoly_vertex(4.5,2.25,gca, [188,30; 189,142; 93,141; 13,41; 14,29]);
setColor(h,'yellow');
h.setVertexSize; %need to reset manually for this version
addNewPositionCallback(h,@(p) title(mat2str(p,3)));
fcn = makeConstrainToRectFcn('impoly',get(gca,'XLim'),...
get(gca,'YLim'));
setPositionConstraintFcn(h,fcn);
&lt;/pre&gt;

A couple more points:

I really try to avoid editing any of the supplied code as it becomes a maintenance headache when you change versions.

Also a useful detective tool is the metaclass class

So mc = ?impoly gives you all sorts of useful info to help design you subclass.

Hope this Helps
Matt W</description>
		<content:encoded><![CDATA[<p>Hi Foster,<br />
This is another good situation for subclassing.<br />
Here is a pretty minimal class for setting the vertex size. Note it does not handle the situation of adding a new vertex or changing vertex color after creation. For now you can just call the setVertexSize method after doing one of those operations. That&#8217;s slightly more sophisticated and may be worth a complete blog entry.</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">classdef</span> impoly_vertex &lt; impoly
&nbsp;
    properties <span style="color: #080;">&#40;</span>GetAccess = public, SetAccess = private<span style="color: #080;">&#41;</span>
        vertexCrossSize;
        vertexDotSize;
    <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%properties</span>
&nbsp;
    <span style="color: #0000FF;">methods</span>
        <span style="color: #0000FF;">function</span> obj =  impoly_vertex<span style="color: #080;">&#40;</span>crossSize,dotSize,<span style="color: #0000FF;">varargin</span><span style="color: #080;">&#41;</span>
            <span style="color: #0000FF;">if</span> <span style="color: #0000FF;">nargin</span> &lt; <span style="color: #33f;">2</span>
                <span style="color: #0000FF;">error</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'impoly_vertex:InsufficientArguments'</span>,<span style="color:#A020F0;">'Both the cross and dot size must be passed as constructor arguments'</span><span style="color: #080;">&#41;</span>;
            <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%if</span>
            obj = obj@impoly<span style="color: #080;">&#40;</span><span style="color: #0000FF;">varargin</span><span style="color: #080;">&#123;</span><span style="color: #F0F;">:</span><span style="color: #080;">&#125;</span><span style="color: #080;">&#41;</span>;
            obj.<span style="">parseSizeInputs</span><span style="color: #080;">&#40;</span>crossSize,dotSize<span style="color: #080;">&#41;</span>;
            obj.<span style="">setVertexSize</span>;
        <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%impoly_vertex</span>
&nbsp;
        <span style="color: #0000FF;">function</span> setVertexSize<span style="color: #080;">&#40;</span>obj<span style="color: #080;">&#41;</span>
            crossChildren = <span style="color: #0000FF;">findobj</span><span style="color: #080;">&#40;</span>obj.<span style="">h_group</span>,<span style="color:#A020F0;">'Type'</span>,<span style="color:#A020F0;">'line'</span>,<span style="color:#A020F0;">'Marker'</span>,<span style="color:#A020F0;">'+'</span><span style="color: #080;">&#41;</span>;
            dotChildren = <span style="color: #0000FF;">findobj</span><span style="color: #080;">&#40;</span>obj.<span style="">h_group</span>,<span style="color:#A020F0;">'Type'</span>,<span style="color:#A020F0;">'line'</span>,<span style="color:#A020F0;">'Marker'</span>,<span style="color:#A020F0;">'O'</span><span style="color: #080;">&#41;</span>;
            <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>crossChildren,<span style="color:#A020F0;">'MarkerSize'</span>,obj.<span style="">vertexCrossSize</span><span style="color: #080;">&#41;</span>;
            <span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>dotChildren,<span style="color:#A020F0;">'MarkerSize'</span>,obj.<span style="">vertexDotSize</span><span style="color: #080;">&#41;</span>;
        <span style="color: #0000FF;">end</span>
&nbsp;
        <span style="color: #0000FF;">function</span> setCrossSize<span style="color: #080;">&#40;</span>obj,cs<span style="color: #080;">&#41;</span>
            obj.<span style="">parseSizeInputs</span><span style="color: #080;">&#40;</span>cs,obj.<span style="">vertexDotSize</span><span style="color: #080;">&#41;</span>;
            obj.<span style="">setVertexSize</span>;
        <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%setCrossSize</span>
&nbsp;
        <span style="color: #0000FF;">function</span> setDotSize<span style="color: #080;">&#40;</span>obj,ds<span style="color: #080;">&#41;</span>
            obj.<span style="">parseSizeInputs</span><span style="color: #080;">&#40;</span>obj.<span style="">vertexCrossSize</span>,ds<span style="color: #080;">&#41;</span>;
            obj.<span style="">setVertexSize</span>;
        <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%setCrossSize</span>
    <span style="color: #0000FF;">end</span>
&nbsp;
    <span style="color: #0000FF;">methods</span> <span style="color: #080;">&#40;</span>Access = protected<span style="color: #080;">&#41;</span>
        <span style="color: #0000FF;">function</span> parseSizeInputs<span style="color: #080;">&#40;</span>obj,cs,ds<span style="color: #080;">&#41;</span>
            validateattributes<span style="color: #080;">&#40;</span>cs,<span style="color: #080;">&#123;</span><span style="color:#A020F0;">'numeric'</span><span style="color: #080;">&#125;</span>,<span style="color: #080;">&#123;</span><span style="color:#A020F0;">'scalar'</span>,<span style="color:#A020F0;">'nonnegative'</span>,<span style="color:#A020F0;">'real'</span><span style="color: #080;">&#125;</span><span style="color: #080;">&#41;</span>;
            validateattributes<span style="color: #080;">&#40;</span>ds,<span style="color: #080;">&#123;</span><span style="color:#A020F0;">'numeric'</span><span style="color: #080;">&#125;</span>,<span style="color: #080;">&#123;</span><span style="color:#A020F0;">'scalar'</span>,<span style="color:#A020F0;">'nonnegative'</span>,<span style="color:#A020F0;">'real'</span><span style="color: #080;">&#125;</span><span style="color: #080;">&#41;</span>;
            obj.<span style="">vertexCrossSize</span> = cs;
            obj.<span style="">vertexDotSize</span> = ds;
        <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%parseSizeInputs</span>
    <span style="color: #0000FF;">end</span> <span style="color: #228B22;">%private Methods    </span>
&nbsp;
<span style="color: #0000FF;">end</span> <span style="color: #228B22;">%impoly_vertex</span></pre></div></div>

<p>Here we let it draw the polygon then find the vertices and change the marker size of the lines that make them up. Usage as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">figure</span>, imshow<span style="color: #080;">&#40;</span><span style="color:#A020F0;">'gantrycrane.png'</span><span style="color: #080;">&#41;</span>;
<span style="color: #228B22;">%about half the regular vertex size</span>
h = impoly_vertex<span style="color: #080;">&#40;</span><span style="color: #33f;">4.5</span>,<span style="color: #33f;">2.25</span>,<span style="color: #0000FF;">gca</span>, <span style="color: #080;">&#91;</span><span style="color: #33f;">188</span>,<span style="color: #33f;">30</span>; <span style="color: #33f;">189</span>,<span style="color: #33f;">142</span>; <span style="color: #33f;">93</span>,<span style="color: #33f;">141</span>; <span style="color: #33f;">13</span>,<span style="color: #33f;">41</span>; <span style="color: #33f;">14</span>,<span style="color: #33f;">29</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
setColor<span style="color: #080;">&#40;</span>h,<span style="color:#A020F0;">'yellow'</span><span style="color: #080;">&#41;</span>;
h.<span style="">setVertexSize</span>; <span style="color: #228B22;">%need to reset manually for this version</span>
addNewPositionCallback<span style="color: #080;">&#40;</span>h,@<span style="color: #080;">&#40;</span>p<span style="color: #080;">&#41;</span> <span style="color: #0000FF;">title</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">mat2str</span><span style="color: #080;">&#40;</span>p,<span style="color: #33f;">3</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
fcn = makeConstrainToRectFcn<span style="color: #080;">&#40;</span><span style="color:#A020F0;">'impoly'</span>,<span style="color: #0000FF;">get</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>,<span style="color:#A020F0;">'XLim'</span><span style="color: #080;">&#41;</span>,<span style="color: #F0F;">...</span>
<span style="color: #0000FF;">get</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">gca</span>,<span style="color:#A020F0;">'YLim'</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
setPositionConstraintFcn<span style="color: #080;">&#40;</span>h,fcn<span style="color: #080;">&#41;</span>;</pre></div></div>

<p>A couple more points:</p>
<p>I really try to avoid editing any of the supplied code as it becomes a maintenance headache when you change versions.</p>
<p>Also a useful detective tool is the metaclass class</p>
<p>So mc = ?impoly gives you all sorts of useful info to help design you subclass.</p>
<p>Hope this Helps<br />
Matt W</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Uicontrol callbacks by Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/uicontrol-callbacks/comment-page-1/#comment-7989</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=223#comment-7989</guid>
		<description>In answer to a &lt;a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/252988" rel="nofollow"&gt;CSSM question&lt;/a&gt; asking for an explanation of the memory leak problem when setting Matlab callbacks directly on the Java object (rather than on their &lt;b&gt;&lt;i&gt;handle&lt;/i&gt;&lt;/b&gt;), there is an &lt;a target="_blank" href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/broifyr-1.html#brrxpv8-1" rel="nofollow"&gt;official MathWorks post on this&lt;/a&gt;.

Also see the following related CSSM threads &lt;a target="_blank" href="http://mathforum.org/kb/message.jspa?messageID=5863891&amp;tstart=0" rel="nofollow"&gt;here&lt;/a&gt; and &lt;a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/240336" rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>In answer to a <a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/252988" rel="nofollow">CSSM question</a> asking for an explanation of the memory leak problem when setting Matlab callbacks directly on the Java object (rather than on their <b><i>handle</i></b>), there is an <a target="_blank" href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/broifyr-1.html#brrxpv8-1" rel="nofollow">official MathWorks post on this</a>.</p>
<p>Also see the following related CSSM threads <a target="_blank" href="http://mathforum.org/kb/message.jspa?messageID=5863891&#038;tstart=0" rel="nofollow">here</a> and <a target="_blank" href="http://www.mathworks.com/matlabcentral/newsreader/view_thread/240336" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting desktop tab completions by Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/setting-desktop-tab-completions/comment-page-1/#comment-7855</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Thu, 04 Mar 2010 22:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1175#comment-7855</guid>
		<description>@Michal - unfortunately, I don't know of any other possible location. As far as I know, Matlab directly opens [matlabroot '/toolbox/local/TC.xml']. We can't win 'em all...

In your toolbox, try modifying TC.xml, with a graceful degradation in case this fails. Something like this:
&lt;pre lang="matlab"&gt;
try
   tabcomplete(...);
catch
   oldFname = fullfile(matlabroot, 'toolbox/local/TC.xml');
   newFname = fullfile(pwd,'TC.xml');
   msgbox(['Please ask your sysadmin to replace ' oldFname ' with ' newFname]);
end
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Michal - unfortunately, I don&#8217;t know of any other possible location. As far as I know, Matlab directly opens [matlabroot '/toolbox/local/TC.xml']. We can&#8217;t win &#8216;em all&#8230;</p>
<p>In your toolbox, try modifying TC.xml, with a graceful degradation in case this fails. Something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #0000FF;">try</span>
   tabcomplete<span style="color: #080;">&#40;</span><span style="color: #F0F;">...</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">catch</span>
   oldFname = <span style="color: #0000FF;">fullfile</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">matlabroot</span>, <span style="color:#A020F0;">'toolbox/local/TC.xml'</span><span style="color: #080;">&#41;</span>;
   newFname = <span style="color: #0000FF;">fullfile</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">pwd</span>,<span style="color:#A020F0;">'TC.xml'</span><span style="color: #080;">&#41;</span>;
   <span style="color: #0000FF;">msgbox</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color:#A020F0;">'Please ask your sysadmin to replace '</span> oldFname <span style="color:#A020F0;">' with '</span> newFname<span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span>;
<span style="color: #0000FF;">end</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>
