<?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>Newsyland Blog &#187; Matlab</title>
	<atom:link href="http://blog.newsyland.com/category/programming/matlab/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.newsyland.com</link>
	<description>tail -f /dev/brain &#62;&#62; blog.newsyland.com</description>
	<lastBuildDate>Thu, 11 Aug 2011 19:56:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>libtiff error in Matlab when attempting to use ImageMagick</title>
		<link>http://blog.newsyland.com/mac-os-x/libtiff-error-in-matlab-when-attempting-to-use-imagemagick</link>
		<comments>http://blog.newsyland.com/mac-os-x/libtiff-error-in-matlab-when-attempting-to-use-imagemagick#comments</comments>
		<pubDate>Sat, 06 Sep 2008 19:20:46 +0000</pubDate>
		<dc:creator>Kirk Ireson</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Original]]></category>

		<guid isPermaLink="false">http://blog.newsyland.com/?p=15</guid>
		<description><![CDATA[Trying to use the Imagemagick toolbox (for me, installed via MacPorts) sometimes doesn&#8217;t work (for example, converting a png image) in Matlab because Matlab for some reason uses the libraries in its path over those given in system call (this is &#8230; <a href="http://blog.newsyland.com/mac-os-x/libtiff-error-in-matlab-when-attempting-to-use-imagemagick">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Trying to use the <a title="imagemagick.org homepage" href="http://www.imagemagick.org/">Imagemagick</a> toolbox (for me, installed via <a href="http://www.macports.org/">MacPorts</a>) sometimes doesn&#8217;t work (for example, converting a png image) in Matlab because Matlab for some reason uses the libraries in its path over those given in <a title="System Call" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/system.html">system</a> call (this is for Mac, but probably for *nix and maybe even Windows).</p>
<p>This is an example call:</p>
<p class="code">[s,w] = system([IMAGEMAGICK_PATH,'convert ',pwd,'/',outfile,'.png -rotate 90 ',pwd,'/',outfile,'.png']);</p>
<p>This is the error:</p>
<p class="code">error:<br />
dyld: Library not loaded: /opt/local/lib/libtiff.3.dylib<br />
Referenced from: /opt/local/bin/convert<br />
Reason: Incompatible library version: convert requires version 12.0.0 or later, but libtiff.3.dylib provides version 11.0.0</p>
<p>The work around is to replace the Matlab library with the ImageMagick one (only need to do this once and will stay until you upgrade Matlab):</p>
<p class="code">cd /Applications/MATLAB74/bin/maci/   (or wherever your Matlab is installed)<br />
mv libtiff.3.7.1.dylib  libtiff.3.7.1.dylib.MATLAB  (give it a different name)<br />
ln -s /opt/local/lib/libtiff.3.dylib libtiff.3.7.1.dylib  (create a soft link to the Imagemagick library file)</p>
<p class="code">
<p><strong>EDIT: This is the much better way to handle this</strong>:</p>
<p class="code">
setenv(&#8216;DYLD_LIBRARY_PATH&#8217;,['/opt/local/lib/:' getenv('DYLD_LIBRARY_PATH')])</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.newsyland.com/mac-os-x/libtiff-error-in-matlab-when-attempting-to-use-imagemagick/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Serial Port communications on Mac via Matlab</title>
		<link>http://blog.newsyland.com/mac-os-x/serial-port-communications-on-mac-via-matlab</link>
		<comments>http://blog.newsyland.com/mac-os-x/serial-port-communications-on-mac-via-matlab#comments</comments>
		<pubDate>Tue, 18 Mar 2008 00:31:12 +0000</pubDate>
		<dc:creator>Kirk Ireson</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Original]]></category>

		<guid isPermaLink="false">http://blog.newsyland.com/uncategorized/serial-port-communications-on-mac-via-matlab</guid>
		<description><![CDATA[I have a rev B (Core 2 Duo from Dec, 2006) Apple MacBook Pro laptop running Leopard OS X (version 10.5.2) and have Matlab version 7.5.0.338 (R2007b). I&#8217;ve just found that I can NOT use the built-in serial port object, &#8230; <a href="http://blog.newsyland.com/mac-os-x/serial-port-communications-on-mac-via-matlab">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have a rev B (Core 2 Duo from Dec, 2006) Apple MacBook Pro laptop running Leopard OS X (version 10.5.2) and have Matlab version 7.5.0.338 (R2007b). I&#8217;ve just found that I can NOT use the built-in serial port object, instead, I get the following error:</p>
<p class="code"> java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver<br />
??? Error using ==&gt; serial.serial at 57<br />
The serial port object is supported on the Solaris, 32-bit Windows and 32-bit Linux platforms only.</p>
<p>So, to get it successfully working, I downloaded these files: SerialComm.m, SerialComm.mexmac and SerialComm.mexmaci from <a href="http://svn.berlios.de/svnroot/repos/osxptb/stable/Psychtoolbox/PsychHardware/">http://svn.berlios.de/svnroot/repos/osxptb/stable/Psychtoolbox/PsychHardware/</a>.</p>
<p>You can then use code like this:</p>
<p class="code"> PORT = 1;<br />
% close (if previously open)<br />
SerialComm( &#8216;close&#8217;, PORT)<br />
% open<br />
SerialComm(&#8216;open&#8217;,PORT,&#8217;9600,n,8,1&#8242;)<br />
% flush the buffers<br />
SerialComm( &#8216;purge&#8217;, PORT)<br />
% status<br />
SerialComm( &#8216;status&#8217;, PORT)<br />
% read<br />
STR = SerialComm( &#8216;readl&#8217;, PORT);<br />
% close<br />
SerialComm( &#8216;close&#8217;, PORT)</p>
<p><strong>[UPDATE 02 Apr, 2008]</strong>: Note, this same code didn&#8217;t seem to work on a recently purchased Macbook.  Good luck.</p>
<p><strong>[UPDATE 27 Mar, 2009]</strong>: I see that in Matlab version 7.8.0 (R2009a) if you go to &#8216;serial&#8217; in Help docs it now says for Mac OS X and Mac OS X 64 you can use serial(&#8216;/dev/tty.KeySerial1&#8242;);  I don&#8217;t have a way of testing that right now, but it&#8217;s possible that you don&#8217;t need to use this third party toolkit anymore. If that&#8217;s true, please leave a note here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.newsyland.com/mac-os-x/serial-port-communications-on-mac-via-matlab/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Matlab 2007b on Leopard Bug</title>
		<link>http://blog.newsyland.com/mac-os-x/matlab-2007b-on-leopard-bug</link>
		<comments>http://blog.newsyland.com/mac-os-x/matlab-2007b-on-leopard-bug#comments</comments>
		<pubDate>Thu, 15 Nov 2007 09:53:52 +0000</pubDate>
		<dc:creator>Kirk Ireson</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://blog.newsyland.com/programming/matlab/matlab-2007b-on-leopard-bug</guid>
		<description><![CDATA[Mathworks Matlab version 2007b in Mac OS X 10.5 Leopard has a scrolling bug where the desktop GUI is sluggish and scrolls slowly. There is a bug fix posted at the Mathworks website, bug #412219, (login required).   It&#8217;s due to &#8230; <a href="http://blog.newsyland.com/mac-os-x/matlab-2007b-on-leopard-bug">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mathworks Matlab version 2007b in Mac OS X 10.5 Leopard has a scrolling bug where the desktop GUI is sluggish and scrolls slowly. There is a bug fix posted at the Mathworks website, <a href="http://www.mathworks.com/support/bugreports/details.html?rp=412219" title="bug #412219">bug #412219</a>, (login required).   It&#8217;s due to a different default Java Graphics2D rendering engine used by OS X 10.5 (Sun2D), where OS X 10.4 used Quartz2D.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.newsyland.com/mac-os-x/matlab-2007b-on-leopard-bug/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

