<?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: Processing a Set of Files &#8211; Repost</title>
	<atom:link href="http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: the_milad</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-29939</link>
		<dc:creator>the_milad</dc:creator>
		<pubDate>Mon, 29 Dec 2008 23:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-29939</guid>
		<description>&quot;Always code as if the programmer having to maintain your code were a raving lunatic who knows where you live.&quot;
So true! 
Currently I&#039;m the raving lunatic and the programmer before ran off to Egypt.

Thank you loren, this is exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>&#8220;Always code as if the programmer having to maintain your code were a raving lunatic who knows where you live.&#8221;<br />
So true!<br />
Currently I&#8217;m the raving lunatic and the programmer before ran off to Egypt.</p>
<p>Thank you loren, this is exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John McElroy</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-29802</link>
		<dc:creator>John McElroy</dc:creator>
		<pubDate>Mon, 13 Oct 2008 18:34:25 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-29802</guid>
		<description>Hey, awesome! I&#039;m going to start digging through these blog entries. I&#039;m glad I found them!!</description>
		<content:encoded><![CDATA[<p>Hey, awesome! I&#8217;m going to start digging through these blog entries. I&#8217;m glad I found them!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28660</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 30 Apr 2008 11:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28660</guid>
		<description>User-

Thanks for the information.  Could I convince you to report it to technical support: http://www.mathworks.com/support/service_requests/contact_support.do
to report these issues?  That&#039;s the best way to get the information back to us so it can be handled appropriately.  Thanks.

--Loren</description>
		<content:encoded><![CDATA[<p>User-</p>
<p>Thanks for the information.  Could I convince you to report it to technical support: <a href="http://www.mathworks.com/support/service_requests/contact_support.do" rel="nofollow">http://www.mathworks.com/support/service_requests/contact_support.do</a><br />
to report these issues?  That&#8217;s the best way to get the information back to us so it can be handled appropriately.  Thanks.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: User</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28648</link>
		<dc:creator>User</dc:creator>
		<pubDate>Tue, 29 Apr 2008 21:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28648</guid>
		<description>yes, that&#039;s all very nice, but matlab file processing is still very imature and not qa&#039;ed well enough. just for example, here are some critical bugs i found in the &#039;dir&#039; command, that have not been solved in the last 3 matlab releases:

1. the &#039;dir&#039; command returns filesize=0 for files which contain unicode characters (such as hebrew or chinese).

2. in some timezones during DST, the datenum returned by &#039;dir&#039; command is offset by 1 *extra* hour, in addition to the DST offset. in other words, it is (wrongly) corrected twice for DST. very annoying.</description>
		<content:encoded><![CDATA[<p>yes, that&#8217;s all very nice, but matlab file processing is still very imature and not qa&#8217;ed well enough. just for example, here are some critical bugs i found in the &#8216;dir&#8217; command, that have not been solved in the last 3 matlab releases:</p>
<p>1. the &#8216;dir&#8217; command returns filesize=0 for files which contain unicode characters (such as hebrew or chinese).</p>
<p>2. in some timezones during DST, the datenum returned by &#8216;dir&#8217; command is offset by 1 *extra* hour, in addition to the DST offset. in other words, it is (wrongly) corrected twice for DST. very annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28349</link>
		<dc:creator>Markus</dc:creator>
		<pubDate>Thu, 17 Apr 2008 21:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28349</guid>
		<description>Aaaaargh!

Roy, do you think you will be able to decipher these cryptic lines after two month? Or one of your colleagues?

I read a good advice for programming somewhere (I don&#039;t remember the exact words):

Always code as if the programmer having to maintain your code were a raving lunatic who knows where you live.

Yours
Markus</description>
		<content:encoded><![CDATA[<p>Aaaaargh!</p>
<p>Roy, do you think you will be able to decipher these cryptic lines after two month? Or one of your colleagues?</p>
<p>I read a good advice for programming somewhere (I don&#8217;t remember the exact words):</p>
<p>Always code as if the programmer having to maintain your code were a raving lunatic who knows where you live.</p>
<p>Yours<br />
Markus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28348</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 17 Apr 2008 21:38:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28348</guid>
		<description>Roy-

You can certainly use your code. It definitely is jam-packed with many MATLAB features!

It&#039;s a little harder to read, in my opinion, but it does get the job done.  I&#039;m not sure you gain any speed either, even if you could trim out the second file loading.

In this case, I think better/worse is really an individual preference.

--Loren</description>
		<content:encoded><![CDATA[<p>Roy-</p>
<p>You can certainly use your code. It definitely is jam-packed with many MATLAB features!</p>
<p>It&#8217;s a little harder to read, in my opinion, but it does get the job done.  I&#8217;m not sure you gain any speed either, even if you could trim out the second file loading.</p>
<p>In this case, I think better/worse is really an individual preference.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28339</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Thu, 17 Apr 2008 20:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/2008/04/17/processing-a-set-of-files-repost/#comment-28339</guid>
		<description>Hi Loren, 

How about this &#039;one liner&#039; solution instead of the loop?
f=@(name) wavwrite(getfield(load(name),&#039;y&#039;),getfield(load(name),&#039;Fs&#039;),name(1:end-4))
cellfun(f,{matfiles(:).name});

Where matfiles as the same as in your post.

In this case, since you need several variables form the mat file (e.g. I have to use load twice per file) its probably less efficient, but I use a similar one liner to rescale lots of images in one go: 

imgfiles=dr(&#039;*.png&#039;);
cellfun(@(name) imwrite(imresize(imread(name),0.5),cat(2,&#039;sml_&#039;,name)),{imgfiles(:).name});

Don&#039;t know if its really better, just following the rule of thumb that as far as matlab is concerned usually less code is better...</description>
		<content:encoded><![CDATA[<p>Hi Loren, </p>
<p>How about this &#8216;one liner&#8217; solution instead of the loop?<br />
f=@(name) wavwrite(getfield(load(name),&#8217;y'),getfield(load(name),&#8217;Fs&#8217;),name(1:end-4))<br />
cellfun(f,{matfiles(:).name});</p>
<p>Where matfiles as the same as in your post.</p>
<p>In this case, since you need several variables form the mat file (e.g. I have to use load twice per file) its probably less efficient, but I use a similar one liner to rescale lots of images in one go: </p>
<p>imgfiles=dr(&#8216;*.png&#8217;);<br />
cellfun(@(name) imwrite(imresize(imread(name),0.5),cat(2,&#8217;sml_&#8217;,name)),{imgfiles(:).name});</p>
<p>Don&#8217;t know if its really better, just following the rule of thumb that as far as matlab is concerned usually less code is better&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

