<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" --><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>File Exchange Pick of the Week</title>
	<link>http://blogs.mathworks.com/pick</link>
	<description>&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=969735&amp;objectType=author"&gt;Bob&lt;/a&gt;, &lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1093599&amp;objectType=author"&gt;Brett&lt;/a&gt; &amp; &lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1094142&amp;objectType=author"&gt;Jiro&lt;/a&gt; share favorite user-contributed submissions from the File Exchange.</description>
	<pubDate>Fri, 20 Nov 2009 14:05:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Regular Expressions…a Cheat Sheet!</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/RzctSph0YN4/</link>
		<comments>http://blogs.mathworks.com/pick/2009/11/20/regular-expressionsa-cheat-sheet/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 14:05:38 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/11/20/regular-expressionsa-cheat-sheet/</guid>
		<description><![CDATA[
   
   In my last Pick, I singled out someone who has contributed widely to image-processing discussions on the CSSM newsgroup. Today, I want to recognize a stalwart contributor to the MATLAB community, both through CSSM and through his numerous submissions
      to the MATLAB Central File [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></introduction>
   <p>In <a href="http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/">my last Pick</a>, I singled out someone who has contributed widely to image-processing discussions on the <a href="http://www.mathworks.com/matlabcentral/newsreader">CSSM newsgroup</a>. Today, I want to recognize a stalwart contributor to the MATLAB community, both through CSSM and through his numerous submissions
      to the MATLAB Central File Exchange. Anyone who has spent time posing or answering questions on CSSM knows of <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/4309">us</a>. And though he has labeled all of his 41 submissions as "pedestrian," most are anything but.
   </p>
   <p>Today's Pick comes to us from us. (Sounds circular, but power-user us apparently doesn't like capitals--or three-letter names!).
      In <a href="http://www.mathworks.com/matlabcentral/fileexchange/20589-rex-a-pedestrian-regular-expression-operator-synopsis-generator">rex: a pedestrian regular expression operator synopsis generator</a>, us has provided a very handy cheat sheet, of sorts, for creating <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f0-42649.html">Regular Expressions</a>. For those of you who haven't yet delved the mysteries of regular expressions, they are powerful devices for searching or
      manipulating strings. But they can be cryptic to create or to decipher. Us's rex is a single-page reference for writing regular
      expressions. The commands can be written to the Command Window, or displayed in a listbox:
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/../images/pick/rex_potw.png"> </p>
   <p>Many of us's files are Pickworthy. His functions are broadly useful, and his code is powerful, concise, and well-written.
      Give his files a browse--there's something there for everyone!
   </p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2498#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_d489cf87ccca47e083161f57b2f26763() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='d489cf87ccca47e083161f57b2f26763 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' d489cf87ccca47e083161f57b2f26763';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Brett Shoelson';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_d489cf87ccca47e083161f57b2f26763()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.8<br /></p>
</div>
<!--
d489cf87ccca47e083161f57b2f26763 ##### SOURCE BEGIN #####
%% Regular Expressions...a Cheat Sheet!
%%
% In
% <http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/ my last Pick>, I singled out someone who has contributed
% widely to image-processing discussions on the <http://www.mathworks.com/matlabcentral/newsreader CSSM newsgroup>. Today, I
% want to recognize a stalwart contributor to the MATLAB
% community, both through CSSM and through his numerous submissions to the
% MATLAB Central File Exchange. Anyone who has spent time posing or answering
% questions on CSSM knows of <http://www.mathworks.com/matlabcentral/fileexchange/authors/4309 us>.
% And though he has labeled all of his 41 submissions as "pedestrian," most
% are anything but.

%%
% Today's Pick comes to us from us. (Sounds circular, but power-user us
% apparently doesn't like capitalsREPLACE_WITH_DASH_DASHor three-letter names!). In <http://www.mathworks.com/matlabcentral/fileexchange/20589-rex-a-pedestrian-regular-expression-operator-synopsis-generator rex: a pedestrian regular expression operator synopsis generator>,
% us has provided a very handy cheat sheet, of sorts, for creating
% <http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f0-42649.html Regular Expressions>. For those of
% you who haven't yet delved the mysteries of regular expressions, they are
% powerful devices for searching or manipulating strings. But they can be
% cryptic to create or to decipher. Us's rex is a single-page reference
% for writing regular expressions. The commands can be written to the
% Command Window, or displayed in a listbox:

%%
% 
% <<rex_potw.png>>
% 

%%
% Many of us's files are Pickworthy. His functions are broadly useful, and his code is powerful, concise, and
% well-written. Give his files a browseREPLACE_WITH_DASH_DASHthere's something there for
% everyone!
%
% <http://blogs.mathworks.com/pick/?p=2498#respond Comments?>
##### SOURCE END ##### d489cf87ccca47e083161f57b2f26763
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/RzctSph0YN4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/11/20/regular-expressionsa-cheat-sheet/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/11/20/regular-expressionsa-cheat-sheet/</feedburner:origLink></item>
		<item>
		<title>This “Peaks” My Interest</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/QzFwQb0PbX8/</link>
		<comments>http://blogs.mathworks.com/pick/2009/11/13/this-peaks-my-interest/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 13:46:00 +0000</pubDate>
		<dc:creator>jiro</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/11/13/this-peaks-my-interest/</guid>
		<description><![CDATA[
   Jiro's pick this week is PeakFinder by Nate Yoder.
   
   "What? Another peak finder?" you might say. Some of you may classify this as one of those utilities that has been created by many people over the years,
      like sudoku and waitbar. Well, [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/15007">Jiro</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/25500-peakfinder"><tt>PeakFinder</tt></a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/39794">Nate Yoder</a>.
   </p>
   <p><i>"What? Another peak finder?"</i> you might say. Some of you may classify this as one of those utilities that has been created by many people over the years,
      like <a href="http://www.mathworks.com/matlabcentral/fileexchange/?term=tag:&#34;sudoku&#34;">sudoku</a> and <a href="http://www.mathworks.com/matlabcentral/fileexchange/?term=tag:&#34;waitbar&#34;">waitbar</a>. Well, peak finding happens to be something dear to my heart.
   </p>
   <p>I have been using MATLAB for almost 10 years since my first year of graduate school. I initially learned by trying to decipher
      my advisor's code. One day, I was struggling to write some code for finding peaks in my data.
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)"><span style="color: #228B22">% Sample data</span>
t = 0:0.01:10;
x = sin(2*t) - 3*cos(3.8*t);</pre><p>That's when my advisor showed me his code:</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">dx = diff(x);          <span style="color: #228B22">% get differences between consecutive points</span>
pkIDX = (dx(1:end-1) &gt;= 0) &amp; (dx(2:end) &lt; 0); <span style="color: #228B22">% look for slope changes</span>
pkIDX = [dx(1)&lt;0, pkIDX, dx(end)&gt;=0];         <span style="color: #228B22">% deal with edges</span>
plot(t, x, t(pkIDX), x(pkIDX), <span style="color: #A020F0">'ro'</span>);</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/potw_peakfinder_01.png"> <p>This was an eye-opener and was the moment I experienced the power of vector operation for the first time. The way I code in
      MATLAB had changed from that point on. ... So when I see "peak finding", it brings back memories.
   </p>
   <p>There are quite a few File Exchange entries for finding peaks (and valleys), including two previous POTW selections: <a href="http://blogs.mathworks.com/pick/2004/03/17/find-spikes-in-data/"><tt>FPEAK</tt></a> and <a href="http://blogs.mathworks.com/pick/2008/05/09/finding-local-extrema/"><tt>EXTREMA</tt></a>. But I really like <tt>peakfinder</tt> by Nate. Not only does his code deal with noisy data (my algorithm above will be useless if the signal is noisy), but also
      his coding practice is quite solid. He has a great help section, robust error-checking of input arguments, and variable input
      and output arguments for ease of use.
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">xNoise = x + 0.3*sin(40*t);   <span style="color: #228B22">% add a few more bumps</span>
peakfinder(xNoise);</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/potw_peakfinder_02.png"> <p>I looked through a few peak finding entries, but I'm sure I may have missed some. Feel free to let me know of others you really
      like <a href="http://blogs.mathworks.com/pick/?p=2494#respond">here</a>.
   </p><script language="JavaScript">
<!--

    function grabCode_8053d02cf91d4435b157ae0a3f8e14ed() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='8053d02cf91d4435b157ae0a3f8e14ed ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 8053d02cf91d4435b157ae0a3f8e14ed';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Jiro Doke';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_8053d02cf91d4435b157ae0a3f8e14ed()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
8053d02cf91d4435b157ae0a3f8e14ed ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/25500-peakfinder
% |PeakFinder|> by 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/39794
% Nate Yoder>.
%
% _"What? Another peak finder?"_ you might say. Some of you may classify
% this as one of those utilities that has been created by many people over
% the years, like
% <http://www.mathworks.com/matlabcentral/fileexchange/?term=tag:"sudoku"
% sudoku> and
% <http://www.mathworks.com/matlabcentral/fileexchange/?term=tag:"waitbar"
% waitbar>. Well, peak finding happens to be something dear to my heart.
% 
% I have been using MATLAB for almost 10 years since my first year of
% graduate school. I initially learned by trying to decipher my advisor's
% code. One day, I was struggling to write some code for finding peaks in
% my data.

% Sample data
t = 0:0.01:10;
x = sin(2*t) - 3*cos(3.8*t);

%%
% That's when my advisor showed me his code:

dx = diff(x);          % get differences between consecutive points
pkIDX = (dx(1:end-1) >= 0) &#038; (dx(2:end) < 0); % look for slope changes
pkIDX = [dx(1)<0, pkIDX, dx(end)>=0];         % deal with edges
plot(t, x, t(pkIDX), x(pkIDX), 'ro');

%%
% This was an eye-opener and was the moment I experienced the power of
% vector operation for the first time. The way I code in MATLAB had changed
% from that point on. ... So when I see "peak finding", it brings back
% memories.
%
% There are quite a few File Exchange entries for finding peaks (and
% valleys), including two previous POTW selections:
% <http://blogs.mathworks.com/pick/2004/03/17/find-spikes-in-data/ |FPEAK|>
% and <http://blogs.mathworks.com/pick/2008/05/09/finding-local-extrema/
% |EXTREMA|>. But I really like |peakfinder| by Nate. Not only does his
% code deal with noisy data (my algorithm above will be useless if the
% signal is noisy), but also his coding practice is quite solid. He has a
% great help section, robust error-checking of input arguments, and
% variable input and output arguments for ease of use.

xNoise = x + 0.3*sin(40*t);   % add a few more bumps
peakfinder(xNoise);

%%
% I looked through a few peak finding entries, but I'm sure I may have
% missed some. Feel free to let me know of others you really like 
% <http://blogs.mathworks.com/pick/?p=2494#respond here>.
##### SOURCE END ##### 8053d02cf91d4435b157ae0a3f8e14ed
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/QzFwQb0PbX8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/11/13/this-peaks-my-interest/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/11/13/this-peaks-my-interest/</feedburner:origLink></item>
		<item>
		<title>Segmenting Coins…a Tutorial on Blob Analysis</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/Is0CxozWfrI/</link>
		<comments>http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 13:58:14 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/</guid>
		<description><![CDATA[
   
   Many of us who have used or participated in comp.soft-sys.matlab over the years--particularly those of us who have had occasion to solve image processing problems--have come to appreciate
      Image Analyst's thoughts on relevant matters.
   
   Recently, Image Analyst had occasion [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></introduction>
   <p>Many of us who have used or participated in <a href="http://www.mathworks.com/matlabcentral/newsreader/">comp.soft-sys.matlab</a> over the years--particularly those of us who have had occasion to solve image processing problems--have come to appreciate
      <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/31862">Image Analyst</a>'s thoughts on relevant matters.
   </p>
   <p>Recently, Image Analyst had occasion to share his first file through the File Exchange--a <a href="http://www.mathworks.com/matlabcentral/fileexchange/25157">demo tutorial on blob analysis</a>. In a nice, well-documented bit of code, IA steps us through an approach to segmenting, and determining the properties of,
      some objects in an image. In this case, the image is a sample ('coins.png') that ships with the <a href="http://www.mathworks.com/products/image/">Image Processing Toolbox</a>.
   </p>
   <p>IA's code shows how one might segment objects of interest (coins) from the background, then use <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/regionprops.html"><tt>regionprops</tt></a> (my favorite IPT function!) to differentiate nickels from dimes, and dull dimes from shiny ones:
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/../images/pick/blobsdemo.png"> </p>
   <p>This is a nice demo--very informative, and certainly worth a read. Two thoughts: 1) IA's code uses <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/bwlabel.html"><tt>bwlabel</tt></a> to calculate a connected components matrix of the image as a precursor to calling <tt>regionprops</tt>. As of R2009a, the new IPT function <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/bwconncomp.html"><tt>bwconncomp</tt></a> replaces <tt>bwlabel</tt> as the preferred approach; it uses significantly less memory, and can be markedly faster! Also, 2) IA shows how one can extract
      the specific pixels (PixelIdxList) associated with each object of interest, then calculate statistics on those pixel intensities
      to differentiate shiny from dull objects. Note that the fourth syntax of <tt>regionprops</tt> in the documentation enables one to avoid this step, and instead to operate directly on the original intensity image. Using
      this syntax, one can calculate directly the MIN, MAX, or MEAN intensitities--or even the weighted centroids-- of each blob
      in the image.
   </p>
   <p>Nice work, Image Analyst!</p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2493#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_7a225168421d45409cc96a1d89ff7009() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='7a225168421d45409cc96a1d89ff7009 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 7a225168421d45409cc96a1d89ff7009';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Brett Shoelson';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_7a225168421d45409cc96a1d89ff7009()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
7a225168421d45409cc96a1d89ff7009 ##### SOURCE BEGIN #####
%% Segmenting Coins...a Tutorial on Blob Analysis
%%
% Many of us who have used or participated in <http://www.mathworks.com/matlabcentral/newsreader/ comp.soft-sys.matlab> over the
% yearsREPLACE_WITH_DASH_DASHparticularly those of us who have had occasion to solve image
% processing problemsREPLACE_WITH_DASH_DASHhave come to appreciate <http://www.mathworks.com/matlabcentral/fileexchange/authors/31862 Image Analyst>'s thoughts on
% relevant matters. 

%%
% Recently, Image Analyst had occasion to share his first file through the
% File ExchangeREPLACE_WITH_DASH_DASHa <http://www.mathworks.com/matlabcentral/fileexchange/25157 demo tutorial on blob analysis>. In a nice,
% well-documented bit of code, IA steps us through an approach to
% segmenting, and determining the properties of, some objects in an image.
% In this case, the image is a sample ('coins.png') that ships with the 
% <http://www.mathworks.com/products/image/ Image Processing Toolbox>. 

%% 
% IA's code shows how one might segment objects of interest (coins) from
% the background, then use <http://www.mathworks.com/access/helpdesk/help/toolbox/images/regionprops.html |regionprops|> (my favorite IPT function!) to differentiate
% nickels from dimes, and dull dimes from shiny ones:
%
%%
% 
% <<BlobsDemo.png>>
% 
%%
% This is a nice demoREPLACE_WITH_DASH_DASHvery informative, and certainly worth a read. Two
% thoughts: 1) IA's code uses <http://www.mathworks.com/access/helpdesk/help/toolbox/images/bwlabel.html |bwlabel|> to calculate a connected components
% matrix of the image as a precursor to calling |regionprops|. As of
% R2009a, the new IPT function <http://www.mathworks.com/access/helpdesk/help/toolbox/images/bwconncomp.html |bwconncomp|> replaces |bwlabel| as the
% preferred approach; it uses significantly less memory, and can be
% markedly faster! Also, 2) IA shows how one can extract the specific
% pixels (PixelIdxList) associated with each object of interest, then
% calculate statistics on those pixel intensities to differentiate shiny
% from dull objects. Note that the fourth syntax of |regionprops| in the documentation enables
% one to avoid this step, and instead to operate directly on the original
% intensity image. Using this syntax, one can calculate directly the MIN,
% MAX, or MEAN intensititiesREPLACE_WITH_DASH_DASHor even the weighted centroidsREPLACE_WITH_DASH_DASH of each blob
% in the image.
%%
% Nice work, Image Analyst!
%
% <http://blogs.mathworks.com/pick/?p=2493#respond Comments?>
##### SOURCE END ##### 7a225168421d45409cc96a1d89ff7009
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/Is0CxozWfrI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/11/06/segmenting-coinsa-tutorial-on-blob-analysis/</feedburner:origLink></item>
		<item>
		<title>allstats</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/WmClTTCb7mc/</link>
		<comments>http://blogs.mathworks.com/pick/2009/10/30/allstats/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 14:42:51 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/10/30/allstats/</guid>
		<description><![CDATA[
   
      Bob's pick this week is Allstats  by Francisco de Castro.
      
   
   The file is simple enough. Given a data set,x = randn(1000,1);
hist(x,100) allstats returns a list of statistical values.
   myStats = allstats(x)myStats = [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/5021">Bob</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/25572-allstats">Allstats</a>  by Francisco de Castro.
      </p>
   </introduction>
   <p>The file is simple enough. Given a data set,</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">x = randn(1000,1);
hist(x,100)</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/pickallstats_01.png"> <p><tt>allstats</tt> returns a list of statistical values.
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">myStats = allstats(x)</pre><pre style="font-style:oblique">myStats = 
      min: -3.1289
      max: 2.9371
     mean: -0.06815
      std: 1.0019
     mode: -3.1289
     q2p5: -1.9519
       q5: -1.7128
      q25: -0.73464
      q50: -0.072006
      q75: 0.55077
      q95: 1.6351
    q97p5: 1.8844
</pre><p>The mean should be close to zero,</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">myStats.mean</pre><pre style="font-style:oblique">ans =
     -0.06815
</pre><p>and the standard deviation should be close to one.</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">myStats.std</pre><pre style="font-style:oblique">ans =
       1.0019
</pre><p>How convenient.</p>
   <p>As it turns out, this month the File Exchange recently celebrated a major milestone. <a href="http://www.mathworks.com/matlabcentral/fileexchange/25572-allstats">Allstats</a> has the honor of being the official 10,000-th submission. Congratulations to Francisco and every contributor who made this
      possible! Growth of the File Exchange has been absolutely amazing.
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/fxgrowth.png"> </p>
   <p>If only my retirement account was that impressive! (sigh)</p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2486#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_dcb967a0e4f64bc0a4cb6315e3f64178() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='dcb967a0e4f64bc0a4cb6315e3f64178 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' dcb967a0e4f64bc0a4cb6315e3f64178';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Robert Bemis';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_dcb967a0e4f64bc0a4cb6315e3f64178()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
dcb967a0e4f64bc0a4cb6315e3f64178 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/5021 Bob>'s 
% pick this week is 
% <http://www.mathworks.com/matlabcentral/fileexchange/25572-allstats Allstats> 
%  by Francisco de Castro.
%%
% The file is simple enough. Given a data set,
x = randn(1000,1);
hist(x,100)
%%
% |allstats| returns a list of statistical values.
myStats = allstats(x)
%%
% The mean should be close to zero,
myStats.mean
%%
% and the standard deviation should be close to one.
myStats.std
%%
% How convenient.
%%
% As it turns out, this month the File Exchange recently celebrated a major
% milestone. 
% <http://www.mathworks.com/matlabcentral/fileexchange/25572-allstats Allstats> 
% has the honor of being the official 10,000-th submission. Congratulations
% to Francisco and every contributor who made this possible! Growth of the
% File Exchange has been absolutely amazing. 
%%
% <<../images/pick/fxgrowth.png>>
%%
% If only my retirement account was that impressive! (sigh)
%%
% <http://blogs.mathworks.com/pick/?p=2486#respond Comments?>

##### SOURCE END ##### dcb967a0e4f64bc0a4cb6315e3f64178
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/WmClTTCb7mc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/10/30/allstats/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/10/30/allstats/</feedburner:origLink></item>
		<item>
		<title>Object Oriented Programming (MATLAB vs others)</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/cGZWrKXMbSY/</link>
		<comments>http://blogs.mathworks.com/pick/2009/10/23/object-oriented-programming-matlab-vs-others/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:01:49 +0000</pubDate>
		<dc:creator>jiro</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/10/23/object-oriented-programming-matlab-vs-others/</guid>
		<description><![CDATA[
   Jiro's pick this week is "Comparison of object oriented code" by our very own Stuart McGarrity.
   
   To some of you, this may be old news, but I know that not everyone is up to date on newer features. The new Object Oriented
      [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/15007">Jiro</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/18972-comparison-of-c-java-python-ruby-and-matlab-using-object-oriented-example">"Comparison of object oriented code"</a> by our very own <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/2962">Stuart McGarrity</a>.
   </p>
   <p>To some of you, this may be old news, but I know that not everyone is up to date on newer features. The new Object Oriented
      Programming capability that was introduced in R2008a has been highlighted several times by <a href="http://blogs.mathworks.com/loren/2008/08/18/when-to-create-classes-in-matlab/">Loren</a>, <a href="http://blogs.mathworks.com/videos/2008/07/07/advanced-matlab-class-system-for-oop-in-matlab-introduction/">Doug</a>, and <a href="http://blogs.mathworks.com/steve/2008/03/21/matlab-76-r2008a/">Steve</a>.
   </p>
   <p>This entry by Stuart provides a nice syntax comparisons between MATLAB and a few of the common object oriented languages (C++,
      Java, Python, Ruby). Take a look at the <a href="http://www.mathworks.com/matlabcentral/fx_files/18972/12/content/Description.html">published HTML</a> to read about it and get a quick side-by-side comparison of these languages.
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/codecompare.png"> </p>
   <p><i>Note: as Stuart mentions in the comments, this is a syntax comparison, and it is not meant for showcasing best practices.
         The <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/ug_intropage.html">documentation</a> is a good place to get such info.</i></p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2485#respond">Comments</a>?
   </p><script language="JavaScript">
<!--

    function grabCode_dfd1458cbd9c42a6970acdc0831b41f7() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='dfd1458cbd9c42a6970acdc0831b41f7 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' dfd1458cbd9c42a6970acdc0831b41f7';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Jiro Doke';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_dfd1458cbd9c42a6970acdc0831b41f7()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
dfd1458cbd9c42a6970acdc0831b41f7 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/18972-comparison-of-c-java-python-ruby-and-matlab-using-object-oriented-example
% "Comparison of object oriented code"> by our very own
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/2962
% Stuart McGarrity>.
%
% To some of you, this may be old news, but I know that not everyone is up
% to date on newer features. The new Object Oriented Programming
% capability that was introduced in R2008a has been highlighted several
% times by
% <http://blogs.mathworks.com/loren/2008/08/18/when-to-create-classes-in-matlab/
% Loren>,
% <http://blogs.mathworks.com/videos/2008/07/07/advanced-matlab-class-system-for-oop-in-matlab-introduction/
% Doug>, and <http://blogs.mathworks.com/steve/2008/03/21/matlab-76-r2008a/
% Steve>.
%
% This entry by Stuart provides a nice syntax comparisons between MATLAB
% and a few of the common object oriented languages (C++, Java, Python,
% Ruby). Take a look at the <http://www.mathworks.com/matlabcentral/fx_files/18972/12/content/Description.html 
% published HTML> to read about it and get a quick side-by-side comparison
% of these languages.
%
% <<codecompare.png>>
%
% _Note: as Stuart mentions in the comments, this is a syntax comparison,
% and it is not meant for showcasing best practices. The <http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_oop/ug_intropage.html 
% documentation> is a good place to get such info._
%
% <http://blogs.mathworks.com/pick/?p=2485#respond Comments>?
##### SOURCE END ##### dfd1458cbd9c42a6970acdc0831b41f7
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/cGZWrKXMbSY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/10/23/object-oriented-programming-matlab-vs-others/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/10/23/object-oriented-programming-matlab-vs-others/</feedburner:origLink></item>
		<item>
		<title>Circular Statistics Toolbox (Directional Statistics)</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/zZQmyJH62s8/</link>
		<comments>http://blogs.mathworks.com/pick/2009/10/16/circular-statistics-toolbox-directional-statistics/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 11:04:45 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/10/16/circular-statistics-toolbox-directional-statistics/</guid>
		<description><![CDATA[
   
      Bob's pick this week is Circular Statistics Toolbox (Directional Statistics) by Philipp Berens.
      
   
   I remember lots of A-ha moments in college when I realized the significance of yet another application for Fourier transforms.
   [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/5021">Bob</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics">Circular Statistics Toolbox (Directional Statistics)</a> by Philipp Berens.
      </p>
   </introduction>
   <p>I remember lots of A-ha moments in college when I realized the significance of yet another application for Fourier transforms.
      For example, calculation of power spectral density in signal processing. The central limit theorem was another pleasant surprise.
      This submission stirred those memories: not unlike bumping into an old friend you haven't seen for a long time. Now all I
      need is a compelling problem that requires circular or directional statistics so I can truly internalize the value of these
      tools for myself.
   </p>
   <p>Philipp first submitted this file in January 2007. There have been a number of review comments over the years. It is currently
      rated 4.4 (on the 5 point scale).
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/circstatsfeedback.png"> </p>
   <p>Downloads have averaged almost 9 per day over the past month as well. So others clearly appreciate it. I also appreciate that
      Philipp recently updated the submission in response to feedback from others. In addition, follow the Acknowledgements trail
      to see that <a href="http://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics">Circular Statistics Toolbox (Directional Statistics)</a> was inspired by <a href="http://www.mathworks.com/matlabcentral/fileexchange/4810-circular-cross-correlation">Circular Cross Correlation</a> which also inspired <a href="http://www.mathworks.com/matlabcentral/fileexchange/24342">Fast Circular (Periodic) Cross Correlation</a>. That's social computing. Keep up the great work, everyone.
   </p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2482#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_61e78d395d114a938862968e6cc1b245() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='61e78d395d114a938862968e6cc1b245 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 61e78d395d114a938862968e6cc1b245';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Robert Bemis';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_61e78d395d114a938862968e6cc1b245()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
61e78d395d114a938862968e6cc1b245 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/5021 Bob>'s 
% pick this week is 
% <http://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics Circular Statistics Toolbox (Directional Statistics)> 
% by Philipp Berens.
%%
% I remember lots of A-ha moments in college when I realized the significance
% of yet another application for Fourier transforms. For example, calculation
% of power spectral density in signal processing. The central limit theorem
% was another pleasant surprise. This submission stirred those memories: not
% unlike bumping into an old friend you haven't seen for a long time. Now all
% I need is a compelling problem that requires circular or directional
% statistics so I can truly internalize the value of these tools for myself.
%%
% Philipp first submitted this file in January 2007. There have been a number
% of review comments over the years. It is currently rated 4.4 (on the 5 point
% scale). 
%%
% <<..\images\pick\circstatsfeedback.png>>
%%
% Downloads have averaged almost 9 per day over the past month as well. So
% others clearly appreciate it. I also appreciate that Philipp recently
% updated the submission in response to feedback from others. In addition,
% follow the Acknowledgements trail to see that 
% <http://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics Circular Statistics Toolbox (Directional Statistics)>
% was inspired by 
% <http://www.mathworks.com/matlabcentral/fileexchange/4810-circular-cross-correlation Circular Cross Correlation>
% which also inspired
% <http://www.mathworks.com/matlabcentral/fileexchange/24342 Fast Circular (Periodic) Cross Correlation>.
% That's social computing. Keep up the great work, everyone.
%%
% <http://blogs.mathworks.com/pick/?p=2482#respond Comments?>

##### SOURCE END ##### 61e78d395d114a938862968e6cc1b245
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/zZQmyJH62s8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/10/16/circular-statistics-toolbox-directional-statistics/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/10/16/circular-statistics-toolbox-directional-statistics/</feedburner:origLink></item>
		<item>
		<title>Colored Area on a Curved Surface</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/-BcqmsbaRko/</link>
		<comments>http://blogs.mathworks.com/pick/2009/10/09/colored-area-on-a-curved-surface/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 13:32:51 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/10/09/colored-area-on-a-curved-surface/</guid>
		<description><![CDATA[
   
      Bob's pick this week is Colored Area on a Curved Surface by Michael Wunder.
      
   
   This is a nice example of quantitative image analysis. Given a heat map and region of interest based on elevation,
  [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/5021">Bob</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/5726">Colored Area on a Curved Surface</a> by Michael Wunder.
      </p>
   </introduction>
   <p>This is a nice example of quantitative image analysis. Given a heat map and region of interest based on elevation,</p>
   <p><img vspace="5" hspace="5" src="http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea_01.png"> </p>
   <p>compute the surface area.</p>
   <p><img vspace="5" hspace="5" src="http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea_04.png"> </p>
   <p>See Michael's <a href="http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea.html">published example</a> for the step by step details.
   </p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2481#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_7be60f4bcbf44dd182682bc6f822bcd7() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='7be60f4bcbf44dd182682bc6f822bcd7 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 7be60f4bcbf44dd182682bc6f822bcd7';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Robert Bemis';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_7be60f4bcbf44dd182682bc6f822bcd7()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.10<br /></p>
</div>
<!--
7be60f4bcbf44dd182682bc6f822bcd7 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/5021 Bob>'s 
% pick this week is 
% <http://www.mathworks.com/matlabcentral/fileexchange/5726 Colored Area on a Curved Surface> 
% by Michael Wunder.
%%
% This is a nice example of quantitative image analysis. Given a heat map and
% region of interest based on elevation, 
%%
% http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea_01.png
%%
% compute the surface area. 
%%
% http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea_04.png
%%
% See Michael's 
% <http://www.mathworks.com/matlabcentral/fx_files/5726/1/content/ColorArea.html published example>
% for the step by step details.
%%
% <http://blogs.mathworks.com/pick/?p=2481#respond Comments?>

##### SOURCE END ##### 7be60f4bcbf44dd182682bc6f822bcd7
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/-BcqmsbaRko" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/10/09/colored-area-on-a-curved-surface/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/10/09/colored-area-on-a-curved-surface/</feedburner:origLink></item>
		<item>
		<title>Integrating the File Exchange with the MATLAB Desktop</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/ak2h-qApTf4/</link>
		<comments>http://blogs.mathworks.com/pick/2009/10/02/integrating-the-file-exchange-with-the-matlab-desktop/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:57:38 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/10/02/integrating-the-file-exchange-with-the-matlab-desktop/</guid>
		<description><![CDATA[
   
      This week's Pick of the Week takes a turn "out of the box"; rather than select a file, I'd like to highlight new functionality
         in MATLAB that allows one to interface with the MATLAB Central File Exchange directly [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p>This week's Pick of the Week takes a turn "out of the box"; rather than select a file, I'd like to highlight new functionality
         in MATLAB that allows one to interface with the MATLAB Central File Exchange directly from one's <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f1-137804.html#f1-131542">MATLAB Desktop</a>.
      </p>
   </introduction>
   <p>As of the current release of MATLAB (R2009b), the Desktop includes a new tool called, appropriately, the <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/br5ktrh-1.html#br5ten7-1">File Exchange Desktop Tool</a>. To access the tool, simply browse from the MATLAB 'Start' button to 'Desktop Tools,' and then to 'File Exchange':
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/../images/pick/menuaccess.png"> </p>
   <p>From there, you'll be presented with a standard MATLAB window that will allow you to find and grab files from the Exchange.</p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/../images/pick/fexdesktoptool.png"> </p>
   <p>Also, be sure to check out this <a href="http://www.mathworks.com/support/2009b/matlab/7.9/demos/new-matlab-file-exchange-access-features-in-r2009b.html">mini video tutorial</a> demonstrating these new capabilities. And be sure to <a href="http://blogs.mathworks.com/pick/?p=2471#respond">tell us what you think!</a></p><script language="JavaScript">
<!--

    function grabCode_773bd5e2d79144cdb0b975c7b9ef7178() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='773bd5e2d79144cdb0b975c7b9ef7178 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 773bd5e2d79144cdb0b975c7b9ef7178';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Brett Shoelson';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_773bd5e2d79144cdb0b975c7b9ef7178()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
773bd5e2d79144cdb0b975c7b9ef7178 ##### SOURCE BEGIN #####
%% Integrating the File Exchange with the MATLAB Desktop
% This week's Pick of the Week takes a turn "out of the box"; rather than
% select a file, I'd like to highlight new functionality in MATLAB that
% allows one to interface with the MATLAB Central File Exchange directly
% from one's <http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f1-137804.html#f1-131542 MATLAB Desktop>.

%%
% As of the current release of MATLAB (R2009b), the Desktop includes a new
% tool called, appropriately, the
% <http://www.mathworks.com/access/helpdesk/help/techdoc/rn/br5ktrh-1.html#br5ten7-1 File Exchange Desktop Tool>. 
% To access the tool, simply browse from the MATLAB 'Start' button to
% 'Desktop Tools,' and then to 'File Exchange':
%%
% 
% <<menuAccess.png>>
% 
%%
% From there, you'll be presented with a standard MATLAB window that will allow you to find and grab files from the Exchange.
%%
% 
% <<fexDesktopTool.png>>
% 
%%
% Also, be sure to check out this <http://www.mathworks.com/support/2009b/matlab/7.9/demos/new-matlab-file-exchange-access-features-in-r2009b.html mini video tutorial> 
% demonstrating these new capabilities. And be sure to
% <http://blogs.mathworks.com/pick/?p=2471#respond tell us what you think!>
##### SOURCE END ##### 773bd5e2d79144cdb0b975c7b9ef7178
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/ak2h-qApTf4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/10/02/integrating-the-file-exchange-with-the-matlab-desktop/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/10/02/integrating-the-file-exchange-with-the-matlab-desktop/</feedburner:origLink></item>
		<item>
		<title>lasso.m</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/86TtHHO2BfE/</link>
		<comments>http://blogs.mathworks.com/pick/2009/09/25/lassom/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 11:51:36 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/09/25/lassom/</guid>
		<description><![CDATA[
   
      Bob's pick this week is lasso.m by Thomas Rutten.
      
   
   Suppose you have a set of XY points. You plot them to see how they spread out. You decide a certain clump of points is special.
 [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/5021">Bob</a>'s pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/3991">lasso.m</a> by Thomas Rutten.
      </p>
   </introduction>
   <p>Suppose you have a set of XY points. You plot them to see how they spread out. You decide a certain clump of points is special.
      How do you get MATLAB to know which points you care about? With <tt>lasso</tt> you can select them with your mouse!
   </p>
   <p>To demonstrate I will use the sunspot example data that ships with MATLAB.</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">load <span style="color: #A020F0">sunspot.dat</span>
[x,y,i] = lasso(sunspot(:,1),sunspot(:,2))</pre><pre style="font-style:oblique">press a KEY to start selection by mouse, LEFT mouse button for selection, RIGHT button closes loop
x =
        1836
        1837
        1848
        1870
y =
        121.5
        138.3
        124.7
          139
i =
   137
   138
   149
   171
</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/pick_lasso_01.png"> <img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/pick_lasso_02.png"> <pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">centroid = [mean(x) mean(y)]</pre><pre style="font-style:oblique">centroid =
       1847.8       130.88
</pre><p>The program prompted me how to start and stop the selection. I left off the semicolon to show the values returned for further
      analysis (ie, centroid calculation). The first plot shows the polygon region I selected. The second plot shows the selected
      points with a free legend and point counter. Nice!
   </p>
   <p>Note: if you like graphically interacting with your XY points be sure to check out <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/brfrh4i-1.html#brfrh4i-2">Data Brushing</a> introduced with R2008a.
   </p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2467#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_0b99d4faa00a4756a6953e25014efb1a() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='0b99d4faa00a4756a6953e25014efb1a ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 0b99d4faa00a4756a6953e25014efb1a';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Robert Bemis';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_0b99d4faa00a4756a6953e25014efb1a()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.9<br /></p>
</div>
<!--
0b99d4faa00a4756a6953e25014efb1a ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/5021 Bob>'s 
% pick this week is 
% <http://www.mathworks.com/matlabcentral/fileexchange/3991 lasso.m> 
% by Thomas Rutten.
%%
% Suppose you have a set of XY points. You plot them to see how they spread
% out. You decide a certain clump of points is special. How do you get MATLAB
% to know which points you care about? With |lasso| you can select them with
% your mouse! 
%%
% To demonstrate I will use the sunspot example data that ships with MATLAB.
load sunspot.dat
[x,y,i] = lasso(sunspot(:,1),sunspot(:,2))
%%
centroid = [mean(x) mean(y)]
%%
% The program prompted me how to start and stop the selection. I left off the
% semicolon to show the values returned for further analysis (ie, centroid
% calculation). The first plot shows the polygon region I selected. The
% second plot shows the selected points with a free legend and point counter.
% Nice!
%%
% Note: if you like graphically interacting with your XY points be sure to
% check out 
% <http://www.mathworks.com/access/helpdesk/help/techdoc/rn/brfrh4i-1.html#brfrh4i-2 Data Brushing>
% introduced with R2008a.
%%
% <http://blogs.mathworks.com/pick/?p=2467#respond Comments?>

##### SOURCE END ##### 0b99d4faa00a4756a6953e25014efb1a
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/86TtHHO2BfE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/09/25/lassom/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/09/25/lassom/</feedburner:origLink></item>
		<item>
		<title>Easier (and less error-prone) creation of Zip files</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/dFIPpiGs8zw/</link>
		<comments>http://blogs.mathworks.com/pick/2009/09/18/easier-and-less-error-prone-creation-of-zip-files/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:21:19 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
		
		<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2009/09/18/easier-and-less-error-prone-creation-of-zip-files/</guid>
		<description><![CDATA[
   
      Brett's Pick this week is exportToZip, by fellow MathWorker Malcolm Wood.
      
   
   I recently received an email from a File Exchange user informing me that a GUI I had shared for morphologically processing
    [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction>
      <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/911">Brett</a>'s Pick this week is <a href="http://www.mathworks.com/matlabcentral/fileexchange/10702"><tt>exportToZip</tt></a>, by fellow MathWorker <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/21286">Malcolm Wood</a>.
      </p>
   </introduction>
   <p>I recently received an email from a File Exchange user informing me that a GUI I had shared for morphologically processing
      images (i.e., <a href="http://www.mathworks.com/matlabcentral/fileexchange/23697"><tt>morphTool</tt></a>) didn't work. As it turns out, I had neglected to include in the Zip file that I uploaded a couple of functions that were
      called internally by <tt>morphTool</tt>.
   </p>
   <p>I've made the same mistake before, and I've also downloaded File Exchange files that were missing some key functionality.</p>
   <p>This email exchange had me thinking about writing a bit of code to automatically create my Zip files, making sure to include
      all necessary supporting function files. MATLAB has a <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/depfun.html"><tt>depfun</tt></a> command that will <i>thoroughly</i> analyze a function and determine its dependencies, including, by default, functions in MATLAB Toolboxes. It can take a little
      while to generate a report, though, and does a lot more work than is necessary just to create a comprehensive Zip file. Alternatively,
      one can easily <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/rn/f3-998197.html#f3-1007592">create a dependency report</a> for the current file active in the MATLAB editor by using "Save and Show Dependency Report" from the Tools menu. That approach
      is much faster than using <tt>depfun</tt> (with its default options), but leaves you then to manually evaluate one-by-one each function that your top-level function
      calls. As you might guess, it's easy to miss a necessary file when you create your Zip.
   </p>
   <p>Before I started coding, I thought I'd check the File Exchange (wouldn't you?), and I quickly found Malcolm's <tt>exportToZip</tt>. Malcolm's file uses his own version of <tt>depfun</tt> (called <tt>mydepfun</tt>), that smartly uses non-default behavior of <tt>depfun</tt> to automatically skip files in MATLAB Toolboxes; <tt>mydepfun</tt> returns the paths to just those files needed for the target Zip file, which is then automatically created.
   </p>
   <p>I tried <tt>exportToZip</tt> on <tt>morphTool</tt>; it worked flawlessly--and quickly! And syntactically, it couldn't be easier to use:
   </p>
   <p><tt>zipfilename = exportToZip(funcname,zipfilename)</tt></p>
   <p>Oh, and incidentally, a new version of <tt>morphTool</tt> will go live soon. Thanks, Malcolm--you saved me a lot of time and effort!
   </p>
   <p>You gotta love the File Exchange!</p>
   <p><a href="http://blogs.mathworks.com/pick/?p=2465#respond">Comments?</a></p><script language="JavaScript">
<!--

    function grabCode_dbc53bc2eb94469eb54a9fc2b703639c() {
        // Remember the title so we can use it in the new page
        title = document.title;

        // Break up these strings so that their presence
        // in the Javascript doesn't mess up the search for
        // the MATLAB code.
        t1='dbc53bc2eb94469eb54a9fc2b703639c ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' dbc53bc2eb94469eb54a9fc2b703639c';
    
        b=document.getElementsByTagName('body')[0];
        i1=b.innerHTML.indexOf(t1)+t1.length;
        i2=b.innerHTML.indexOf(t2);
 
        code_string = b.innerHTML.substring(i1, i2);
        code_string = code_string.replace(/REPLACE_WITH_DASH_DASH/g,'--');

        // Use /x3C/g instead of the less-than character to avoid errors 
        // in the XML parser.
        // Use '\x26#60;' instead of '<' so that the XML parser
        // doesn't go ahead and substitute the less-than character. 
        code_string = code_string.replace(/\x3C/g, '\x26#60;');

        author = 'Brett Shoelson';
        copyright = 'Copyright 2009 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add author and copyright lines at the bottom if specified.
        if ((author.length > 0) || (copyright.length > 0)) {
            d.writeln('');
            d.writeln('%%');
            if (author.length > 0) {
                d.writeln('% _' + author + '_');
            }
            if (copyright.length > 0) {
                d.writeln('% _' + copyright + '_');
            }
        }

        d.write('</pre>\n');
      
      d.title = title + ' (MATLAB code)';
      d.close();
      }   
      
-->
</script><p style="text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray"><br /><a href="javascript:grabCode_dbc53bc2eb94469eb54a9fc2b703639c()"><span style="font-size: x-small;        font-style: italic;">Get 
            the MATLAB code 
            <noscript>(requires JavaScript)</noscript></span></a><br /><br />
      Published with MATLAB&reg; 7.8<br /></p>
</div>
<!--
dbc53bc2eb94469eb54a9fc2b703639c ##### SOURCE BEGIN #####
%% Easier (and less error-prone) creation of Zip files
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/911 Brett>'s
% Pick this week is <http://www.mathworks.com/matlabcentral/fileexchange/10702 |exportToZip|>,
% by fellow MathWorker <http://www.mathworks.com/matlabcentral/fileexchange/authors/21286 Malcolm Wood>.

%%
% I recently received an email from a File Exchange user informing me that a GUI I
% had shared for morphologically processing images (i.e., <http://www.mathworks.com/matlabcentral/fileexchange/23697 |morphTool|>) didn't work.
% As it turns out, I had neglected to 
% include in the Zip file that I uploaded a couple of functions that were called internally by |morphTool|.

%% 
% I've made the same mistake before, and I've also downloaded File Exchange files that were missing some key functionality.

%% 
% This email exchange had me thinking about writing a bit of code to
% automatically create my Zip files, making sure to include all necessary
% supporting function files. MATLAB has a <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/depfun.html |depfun|>
% command that will _thoroughly_ analyze a function and determine its dependencies,
% including, by default, functions in MATLAB Toolboxes. It can take a little while to generate a report, though, and does a lot more work than is necessary
% just to create a comprehensive Zip file. Alternatively, one can easily <http://www.mathworks.com/access/helpdesk/help/techdoc/rn/f3-998197.html#f3-1007592 create a dependency report>
% for the current file active in the MATLAB editor
% by using "Save and Show Dependency Report" from the Tools menu.
% That approach is much faster than using |depfun| (with its default options), but leaves you then to manually evaluate
% one-by-one each function that your top-level function calls. As you might
% guess, it's easy to miss a necessary file when you create your Zip.

%%
% Before I started coding, I thought I'd check the File Exchange (wouldn't you?), and I quickly found Malcolm's |exportToZip|.
% Malcolm's file uses his own version of |depfun| (called |mydepfun|), that
% smartly uses non-default behavior of |depfun| to automatically skip files
% in MATLAB Toolboxes; |mydepfun| returns the paths to just those files needed for the target
% Zip file, which is then automatically created. 

%%
% I tried |exportToZip| on |morphTool|; it worked flawlesslyREPLACE_WITH_DASH_DASHand
% quickly! And syntactically, it couldn't be easier to use:

%%
% |zipfilename = exportToZip(funcname,zipfilename)|

%%
% Oh, and incidentally, a new version of |morphTool| will go live soon.
% Thanks, MalcolmREPLACE_WITH_DASH_DASHyou saved me a lot of time and effort!

%%
% You gotta love the File Exchange!
%%
% <http://blogs.mathworks.com/pick/?p=2465#respond Comments?> 
##### SOURCE END ##### dbc53bc2eb94469eb54a9fc2b703639c
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/dFIPpiGs8zw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2009/09/18/easier-and-less-error-prone-creation-of-zip-files/feed/</wfw:commentRss>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2009/09/18/easier-and-less-error-prone-creation-of-zip-files/</feedburner:origLink></item>
	</channel>
</rss>
