<?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 on: EditorMacro &#8211; assign a keyboard macro in the Matlab editor</title> <atom:link href="http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/feed/" rel="self" type="application/rss+xml" /><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/</link> <description>Charting Matlab's unsupported hidden underbelly</description> <lastBuildDate>Fri, 18 May 2012 13:56:51 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.1</generator> <item><title>By: Jason McMains</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3509</link> <dc:creator>Jason McMains</dc:creator> <pubDate>Mon, 26 Oct 2009 03:28:58 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3509</guid> <description>in any version specific code I&#039;ve written, I had actually accounted for the 7.0.1 issue by taking only the first 3 characters max, which would give me 7.0 or 7.5 etc. I had just heavily simplified for posting. so really line 2 should read:
&lt;pre lang=&quot;matlab&quot;&gt;
if str2double(Mversion.Version(1:min([3 end])) &gt;= 7
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>in any version specific code I&#8217;ve written, I had actually accounted for the 7.0.1 issue by taking only the first 3 characters max, which would give me 7.0 or 7.5 etc. I had just heavily simplified for posting. so really line 2 should read:</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>Mversion.<span style="color: #0000FF;">Version</span><span style="color: #080;">&#40;</span><span style="color: #33f;">1</span><span style="color: #F0F;">:</span><span style="color: #0000FF;">min</span><span style="color: #080;">&#40;</span><span style="color: #080;">&#91;</span><span style="color: #33f;">3</span> <span style="color: #0000FF;">end</span><span style="color: #080;">&#93;</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span> &gt;= <span style="color: #33f;">7</span></pre></div></div>]]></content:encoded> </item> <item><title>By: Mike Katz</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3439</link> <dc:creator>Mike Katz</dc:creator> <pubDate>Fri, 23 Oct 2009 15:26:07 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3439</guid> <description>True. It&#039;s on the file exchange for that purpose, but I understand. Just wanted to point it out, though.</description> <content:encoded><![CDATA[<p>True. It&#8217;s on the file exchange for that purpose, but I understand. Just wanted to point it out, though.</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3438</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Fri, 23 Oct 2009 14:38:24 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3438</guid> <description>Unfortunately Mike, &lt;b&gt;&lt;i&gt;varLessThan&lt;/i&gt;&lt;/b&gt; was only introduced in recent Matlab releases, so if I have an older release I would get an error. Which brings me back to try/catch which works for &lt;u&gt;all&lt;/u&gt; Matlab releases :-)</description> <content:encoded><![CDATA[<p>Unfortunately Mike, <b><i>varLessThan</i></b> was only introduced in recent Matlab releases, so if I have an older release I would get an error. Which brings me back to try/catch which works for <u>all</u> Matlab releases <img
src='http://undocumentedmatlab.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Mike Katz</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3437</link> <dc:creator>Mike Katz</dc:creator> <pubDate>Fri, 23 Oct 2009 14:26:44 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3437</guid> <description>..forgot to mention that to @Jason that str2double is dangerous b/c some versions of MATLAB such as R14SP1 don&#039;t have straightfoward numbers, it&#039;s 7.0.1</description> <content:encoded><![CDATA[<p>..forgot to mention that to @Jason that str2double is dangerous b/c some versions of MATLAB such as R14SP1 don&#8217;t have straightfoward numbers, it&#8217;s 7.0.1</p> ]]></content:encoded> </item> <item><title>By: Mike Katz</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3436</link> <dc:creator>Mike Katz</dc:creator> <pubDate>Fri, 23 Oct 2009 14:24:40 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3436</guid> <description>RE: the try/catch case, the &lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/verlessthan.html&quot; rel=&quot;nofollow&quot;&gt;verLessThan&lt;/a&gt; function is meant to address providing version-dependent behavior.</description> <content:encoded><![CDATA[<p>RE: the try/catch case, the <a
href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/verlessthan.html" rel="nofollow">verLessThan</a> function is meant to address providing version-dependent behavior.</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3420</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Thu, 22 Oct 2009 23:41:01 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3420</guid> <description>Andrey - you are correct: try-catch should be used, but excessive use has drawbacks. I guess this is true for most things in life... As elsewhere, there isn&#039;t a clear-cut definition of how much is &quot;just right&quot; - we should all apply judgment and common-sense.</description> <content:encoded><![CDATA[<p>Andrey &#8211; you are correct: try-catch should be used, but excessive use has drawbacks. I guess this is true for most things in life&#8230; As elsewhere, there isn&#8217;t a clear-cut definition of how much is &#8220;just right&#8221; &#8211; we should all apply judgment and common-sense.</p> ]]></content:encoded> </item> <item><title>By: Andrey</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-3386</link> <dc:creator>Andrey</dc:creator> <pubDate>Wed, 21 Oct 2009 12:58:25 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-3386</guid> <description>Yair Hi!There are also some reasons why using try-catch isn&#039;t good in this case1) &lt;b&gt;Simple Code &lt;/b&gt;  - The code is harder to understand.
2) &lt;b&gt;Debugging&lt;/b&gt;  - When using try-catch without taking a look at the caught exception, you might miss an error which isn&#039;t related to Matlab version at all. Since you catch it, you will never see the stack in Matlab.
3) &lt;b&gt;Case handling &lt;/b&gt; - You will eventually need another try-catch for the matlab 6 section, to handle other versions (not 6 or 7). So what you get is basically a lot of recursive try-catch, which makes the code even less understandable.</description> <content:encoded><![CDATA[<p>Yair Hi!</p><p>There are also some reasons why using try-catch isn&#8217;t good in this case</p><p>1) <b>Simple Code </b> &#8211; The code is harder to understand.<br
/> 2) <b>Debugging</b> &#8211; When using try-catch without taking a look at the caught exception, you might miss an error which isn&#8217;t related to Matlab version at all. Since you catch it, you will never see the stack in Matlab.<br
/> 3) <b>Case handling </b> &#8211; You will eventually need another try-catch for the matlab 6 section, to handle other versions (not 6 or 7). So what you get is basically a lot of recursive try-catch, which makes the code even less understandable.</p> ]]></content:encoded> </item> <item><title>By: EditorMacro v2 - setting Command Window key-bindings &#124; Undocumented Matlab</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-2225</link> <dc:creator>EditorMacro v2 - setting Command Window key-bindings &#124; Undocumented Matlab</dc:creator> <pubDate>Fri, 21 Aug 2009 08:35:58 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-2225</guid> <description>[...] The EditorMacro utility was extended to support built-in Matlab Editor and Command-Window actions and key-bindings. This post describes the changes and the implementation details. [...]</description> <content:encoded><![CDATA[<p>[...] The EditorMacro utility was extended to support built-in Matlab Editor and Command-Window actions and key-bindings. This post describes the changes and the implementation details. [...]</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-1801</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Fri, 17 Jul 2009 14:01:34 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-1801</guid> <description>@Neil - In answer to your question, I posted a follow-up: http://undocumentedmatlab.com/blog/non-textual-editor-actions/Removing text can be done using hDocument.delete(startPos,endPos)Enjoy :-)
Yair</description> <content:encoded><![CDATA[<p>@Neil &#8211; In answer to your question, I posted a follow-up: <a
href="http://undocumentedmatlab.com/blog/non-textual-editor-actions/" rel="nofollow">http://undocumentedmatlab.com/blog/non-textual-editor-actions/</a></p><p>Removing text can be done using hDocument.delete(startPos,endPos)</p><p>Enjoy <img
src='http://undocumentedmatlab.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br
/> Yair</p> ]]></content:encoded> </item> <item><title>By: Neil</title><link>http://undocumentedmatlab.com/blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/#comment-1752</link> <dc:creator>Neil</dc:creator> <pubDate>Tue, 14 Jul 2009 20:29:35 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=437#comment-1752</guid> <description>Great post -- one step closer into the black hole void of the matlab gui. Do you know of any way of running commands other than inserting text, for example, moving the cursor, deleting a word/line, or more dynamic text editing?n</description> <content:encoded><![CDATA[<p>Great post &#8212; one step closer into the black hole void of the matlab gui. Do you know of any way of running commands other than inserting text, for example, moving the cursor, deleting a word/line, or more dynamic text editing?</p><p>n</p> ]]></content:encoded> </item> </channel> </rss>

<!-- W3 Total Cache: Minify debug info:
Engine:             disk: basic
Theme:              b7666
Template:           single
-->
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: undocumentedmatlab.com @ 2012-05-18 22:44:57 -->

<!-- W3 Total Cache: Page cache debug info:
Engine:             disk: enhanced
Cache key:          blog/editormacro-assign-a-keyboard-macro-in-the-matlab-editor/feed/_index.xml_gzip
Caching:            enabled
Status:             not cached
Creation Time:      0.510s
Header info:
X-Pingback:         http://undocumentedmatlab.com/blog/xmlrpc.php
Set-Cookie:         wpgb_visit_last_php-default=1337406297; expires=Sun, 19-May-2013 05:44:57 GMT; path=/
Link:               <http://undocumentedmatlab.com/?p=437>; rel=shortlink
Content-Type:       text/xml; charset=UTF-8
Last-Modified:      Sat, 19 May 2012 05:44:57 GMT
Vary:               Accept-Encoding, Cookie
Expires:            Sat, 19 May 2012 06:44:57 GMT
Pragma:             public
Cache-Control:      public, must-revalidate, proxy-revalidate
Etag:               2db1d029d606ab236646f918f63bb5e7
Content-Encoding:   gzip
-->
