<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DDE &#8211; Undocumented Matlab</title>
	<atom:link href="https://undocumentedmatlab.com/articles/tag/dde/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 21 Jul 2010 10:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>Matlab DDE support</title>
		<link>https://undocumentedmatlab.com/articles/matlab-dde-support?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=matlab-dde-support</link>
					<comments>https://undocumentedmatlab.com/articles/matlab-dde-support#comments</comments>
		
		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 21 Jul 2010 10:00:00 +0000</pubDate>
				<category><![CDATA[Medium risk of breaking in future versions]]></category>
		<category><![CDATA[Semi-documented function]]></category>
		<category><![CDATA[Undocumented feature]]></category>
		<category><![CDATA[DDE]]></category>
		<category><![CDATA[Pure Matlab]]></category>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1756</guid>

					<description><![CDATA[<p>Windows DDE is an unsupported and undocumented feature of Matlab, that can be used to improve the work-flow in the Windows environment</p>
<p>The post <a rel="nofollow" href="https://undocumentedmatlab.com/articles/matlab-dde-support">Matlab DDE support</a> appeared first on <a rel="nofollow" href="https://undocumentedmatlab.com">Undocumented Matlab</a>.</p>
<div class='yarpp-related-rss'>
<h3>Related posts:</h3><ol>
<li><a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents" rel="bookmark" title="HTML support in Matlab uicomponents">HTML support in Matlab uicomponents </a> <small>Matlab uicomponents support HTML and CSS, enabling colored items, superscript/subscript, fonts, bold/italic/underline and many other modifications...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/matlab-installation-woes" rel="bookmark" title="Matlab installation woes">Matlab installation woes </a> <small>Matlab has some issues when installing a new version. This post discusses some of them and how to overcome them....</small></li>
<li><a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps" rel="bookmark" title="Using pure Java GUI in deployed Matlab apps">Using pure Java GUI in deployed Matlab apps </a> <small>Using pure-Java GUI in deployed Matlab apps requires a special yet simple adaptation. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/types-of-undocumented-matlab-aspects" rel="bookmark" title="Types of undocumented Matlab aspects">Types of undocumented Matlab aspects </a> <small>This article lists the different types of undocumented/unsupported/hidden aspects in Matlab...</small></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a target="_blank" rel="nofollow" href="http://en.wikipedia.org/wiki/Dynamic_Data_Exchange">Windows DDE</a> was a 1990&#8217;s technology used to transfer control between Windows applications. DDE was fully supported and documented in old Matlab releases (<a target="_blank" rel="nofollow" href="http://www.mathworks.com/access/helpdesk_r13/help/techdoc/matlab_external/ch07cl21.html">R13</a>, <a target="_blank" rel="nofollow" href="http://www.system.nada.kth.se/unix/software/matlab/Release_14.1/techdoc/matlab_external/ch8_co28.html">R14</a>). DDE is no longer documented in Matlab, although it apparently still works. In fact, Matlab <a target="_blank" rel="nofollow" href="http://www.system.nada.kth.se/unix/software/matlab/Release_14.1/techdoc/matlab_external/ch8_co28.html">says</a>:<br />
<q>As of MATLAB version 5.1, all development work for the DDE Server and Client has been stopped and no further development will be done. The MathWorks strongly recommends that you migrate to the MATLAB interface to COM technology that is documented.</q><br />
In the past decade, DDE has been superseded by newer Windows technologies deriving from <a target="_blank" rel="nofollow" href="http://en.wikipedia.org/wiki/Component_Object_Model">COM</a>, which is supported by Matlab. However, DDE is still used for some Windows infrastructure functions such as cut/copy/paste (CCP) and the Windows Shell file association. Today&#8217;s article, based on information given to me by Martin H&ouml;cker, a reader of this blog, uses this fact to interface the Windows Explorer with Matlab.<br />
Martin works on an experiment that outputs a large number of small data files that have a &#8220;THe&#8221; extension. He wrote a Matlab script that parses and plots the data files individually. This script is called &#8220;THePlotter.m&#8221; and is on the Matlab path. But calling this script with the command &#8220;THePlotter(&#8216;D:\Data\somedata.THe&#8217;)&#8221; in Matlab&#8217;s console is tedious, especially if we need to check hundreds of files.<br />
Since all data files have the same &#8220;.THe&#8221; extension, Martin associated this file type with Matlab so double-clicking any file in Explorer will plot the data in Matlab. It is very easy to set this up using DDE:</p>
<ol>
<li>associate the &#8220;.THe&#8221; file type with Matlab as shown below (note: use the MATLAB.exe file in the /bin/win32 or /bin/win64 subfolder). Now Matlab will generate an error for a double-click on the file, but we don&#8217;t care.<br />
<center><figure style="width: 330px" class="wp-caption aligncenter"><a target="_blank" href="/images/DDE_Explorer_Associate.png"><img fetchpriority="high" decoding="async" alt="Associating an extension with Matlab (click for details)" src="https://undocumentedmatlab.com/images/DDE_Explorer_Associate.png" title="Associating an extension with Matlab (click for details)" width="330" height="439" /></a><figcaption class="wp-caption-text">Associating an extension with Matlab (click for details)</figcaption></figure></center></li>
<li>in Windows Explorer, click on Tools / Folder Options / File Types</li>
<li>select the &#8220;.THe&#8221; extension and click &#8220;Advanced&#8221;<br />
<center><figure style="width: 400px" class="wp-caption aligncenter"><a target="_blank" href="/images/DDE_Explorer_Edit.png"><img decoding="async" alt="Editing the file association details" src="https://undocumentedmatlab.com/images/DDE_Explorer_Edit.png" title="Editing the file association details" width="400" height="328" /></a><figcaption class="wp-caption-text">Editing the file association details</figcaption></figure></center></li>
<li>set this to be the default action upon mouse double-click or keyboard ENTER</li>
<li>select the &#8220;open&#8221; action, and click &#8220;Edit&#8230;&#8221;</li>
<li>rename the action &#8220;plot&#8221; (renaming is optional) and click the &#8220;Use DDE&#8221; checkbox</li>
<li>enter the DDE information as seen below:</li>
</ol>
<p><center><figure style="width: 450px" class="wp-caption aligncenter"><a target="_blank" href="/images/DDE_Explorer_Settings.png"><img decoding="async" alt="Windows Explorer settings (click for details)" src="https://undocumentedmatlab.com/images/DDE_Explorer_Settings.png" title="Windows Explorer settings (click for details)" width="450" height="233" /></a><figcaption class="wp-caption-text">Windows Explorer settings (click for details)</figcaption></figure></center><br />
It is even possible to have several &#8220;actions&#8221; for the file: Martin has &#8220;Plot&#8221;, and &#8220;Add to plot&#8221;, which allows plotting multiple files at once by simply choosing &#8220;Add to plot&#8221; with a right click in Windows Explorer:<br />
<center><figure style="width: 326px" class="wp-caption aligncenter"><a target="_blank" href="/images/DDE_Explorer_Use.png"><img loading="lazy" decoding="async" alt="Windows Explorer use (click for details)" src="https://undocumentedmatlab.com/images/DDE_Explorer_Use.png" title="Windows Explorer use (click for details)" width="326" height="85" /></a><figcaption class="wp-caption-text">Windows Explorer use (click for details)</figcaption></figure></center><br />
Behind the scenes, all this is simply a GUI wrapper for adding/modifying the Windows Registry:<br />
<center><figure style="width: 432px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" alt="Registry entry for the Shell file association" src="https://undocumentedmatlab.com/images/DDE_Registry.png" title="Registry entry for the Shell file association" width="432" height="258" /><figcaption class="wp-caption-text">Registry entry for the Shell file association</figcaption></figure></center><br />
Note that despite some information in the R13/R14 documentation, we do not need to run Matlab with the /Automation startup flag (or any other special modification for that matter), at least in recent Matlab releases.<br />
The biggest advantage of using DDE: It does not open up a new instance of Matlab whenever you click on a file. This saves an incredible amount of start-up time.<br />
One thing we cannot do, is to pass parameter/value pairs to the &#8220;THePlotter&#8221; function. The problem possibly lies in the way that Matlab parses the DDE commands &#8211; the parameter is enclosed by quotes, and Matlab seems to turn these quotes into double-quotes, and then chokes on itself&#8230;<br />
Have you found another neat trick to enhance your work-flow? If so, please share it in the <a href="/articles/matlab-dde-support/#respond">comments</a> section below, or <a href="mailto:%20altmany%20@gmail.com?subject=Undocumented%20Matlab&amp;body=Hi%20Yair,%20&amp;cc=;&amp;bcc=" rel="nofollow" target="_blank" onclick="var n='altmany'; var d='gmail.com'; window.open('mailto:'+n+'@'+d+'?subject=Undocumented Matlab&amp;body=Hi Yair, '); return false;">send me an email</a><br />
p.s.: Readers who are interested in using Matlab&#8217;s DDE functionality programmatically, are welcome to read and use the following semi-documented built-in functions: <i><b>ddeadv, ddeexec, ddeinit, ddepoke, ddereq, ddeterm, ddeunadv</b></i>. These functions have a readable help section, but no doc page nor official support.</p>
<p>The post <a rel="nofollow" href="https://undocumentedmatlab.com/articles/matlab-dde-support">Matlab DDE support</a> appeared first on <a rel="nofollow" href="https://undocumentedmatlab.com">Undocumented Matlab</a>.</p>
<div class='yarpp-related-rss'>
<h3>Related posts:</h3><ol>
<li><a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents" rel="bookmark" title="HTML support in Matlab uicomponents">HTML support in Matlab uicomponents </a> <small>Matlab uicomponents support HTML and CSS, enabling colored items, superscript/subscript, fonts, bold/italic/underline and many other modifications...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/matlab-installation-woes" rel="bookmark" title="Matlab installation woes">Matlab installation woes </a> <small>Matlab has some issues when installing a new version. This post discusses some of them and how to overcome them....</small></li>
<li><a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps" rel="bookmark" title="Using pure Java GUI in deployed Matlab apps">Using pure Java GUI in deployed Matlab apps </a> <small>Using pure-Java GUI in deployed Matlab apps requires a special yet simple adaptation. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/types-of-undocumented-matlab-aspects" rel="bookmark" title="Types of undocumented Matlab aspects">Types of undocumented Matlab aspects </a> <small>This article lists the different types of undocumented/unsupported/hidden aspects in Matlab...</small></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://undocumentedmatlab.com/articles/matlab-dde-support/feed</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
