<?xml version="1.0" encoding="UTF-8"?>
<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: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/" 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=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>
	<lastBuildDate>Fri, 25 May 2012 13:26:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mathworks/pick" /><feedburner:info uri="mathworks/pick" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>grep – Text searching utility</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/m1qLimE7mwQ/</link>
		<comments>http://blogs.mathworks.com/pick/2012/05/25/grep-text-searching-utility/#comments</comments>
		<pubDate>Fri, 25 May 2012 13:26:26 +0000</pubDate>
		<dc:creator>Jiro Doke</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3576</guid>
		<description><![CDATA[Jiro's pick this week is grep: a pedestrian, very fast grep utility by Us. This week's pick is a recommendation from Yair, who himself is a prominent participant on MATLAB Central. Us has created a number of very useful functions over the years, and there's nothing pedestrian about his entries! This week, I was in [...]]]></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/9647">grep: a pedestrian, very fast grep utility</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/4309">Us</a>.
   </p>
   <p>This week's pick is a recommendation from <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/27420">Yair</a>, who himself is a prominent participant on MATLAB Central. Us has created a number of very useful functions over the years,
      and there's nothing pedestrian about his entries!
   </p>
   <p>This week, I was in Seattle presenting at University of Washington, and during the seminar I received a question about the
      best way to scan through a file for a certain text pattern that denotes the beginning of data. She was scanning the file line
      by line using <a href="http://www.mathworks.com/help/matlab/ref/textscan.html"><tt>textscan</tt></a> to find the text of interest, and she was wondering if there was a more efficient way. The method she described seemed pretty
      reasonable. <tt>textscan</tt> is very efficient in scanning text files, and it's a good function for dealing with extremely large files, if you want to
      read them in chunks. Then I remembered Us's <tt>grep</tt>. I remembered Yair had <a href="http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/#comment-14491">suggested</a> it, and that there were many positive responses to the entry. I suggested that she take a look at the function and to use
      it in conjunction with <tt>textscan</tt> to do the data reading afterwards.
   </p>
   <p>Here's a quick example of how it works. In a folder called "data_files", I have 10 files, each of which contains experimental
      data from 100 tests. Each test is separated by a line indicating the test number.
   </p><pre>   Test  1
   1.776199
   3.552398
   5.328597
     .
     .
     .
   Test  2
   7.250518
   4.510056
   5.797272
     .
     .
     .
   Test  3
     .
     .
     .<p></p></pre><p>Let's say that I want to extract data for Test 60. Because each file contains different number of data points, the file sizes
      are different.
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">fInfo = dir(<span style="color: #A020F0">'data_files/*.txt'</span>);
s = [{fInfo.name}; num2cell([fInfo.bytes]/2^20)];
fprintf(<span style="color: #A020F0">'%s: %4.1f MB\n'</span>, s{:})</pre><pre style="font-style:oblique">ModelResults01.txt:  8.2 MB
ModelResults02.txt:  7.7 MB
ModelResults03.txt: 13.0 MB
ModelResults04.txt:  1.9 MB
ModelResults05.txt:  1.6 MB
ModelResults06.txt: 24.1 MB
ModelResults07.txt: 11.8 MB
ModelResults08.txt:  9.1 MB
ModelResults09.txt: 20.6 MB
ModelResults10.txt: 20.7 MB
</pre><p><p>To identify the lines where Test 60 starts and ends, we can look for the texts "Test  60" and "Test  61".</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">tic;
[fl, p] = grep(<span style="color: #A020F0">'-u -n'</span>, {<span style="color: #A020F0">'Test  60'</span>, <span style="color: #A020F0">'Test  61'</span>}, <span style="color: #A020F0">'data_files/*.txt'</span>);
disp(<span style="color: #A020F0">' '</span>); toc;</pre><pre style="font-style:oblique">ModelResults01.txt:175704: Test  60
ModelResults01.txt:178682: Test  61
ModelResults02.txt:164907: Test  60
ModelResults02.txt:167702: Test  61
ModelResults03.txt:278423: Test  60
ModelResults03.txt:283142: Test  61
ModelResults04.txt:40417: Test  60
ModelResults04.txt:41102: Test  61
ModelResults05.txt:33337: Test  60
ModelResults05.txt:33902: Test  61
ModelResults06.txt:514069: Test  60
ModelResults06.txt:522782: Test  61
ModelResults07.txt:251578: Test  60
ModelResults07.txt:255842: Test  61
ModelResults08.txt:194584: Test  60
ModelResults08.txt:197882: Test  61
ModelResults09.txt:440201: Test  60
ModelResults09.txt:447662: Test  61
ModelResults10.txt:440850: Test  60
ModelResults10.txt:448322: Test  61
 
Elapsed time is 1.936893 seconds.
</pre><p><p>As you can see from the comments on the File Exchange entry page, the function runs extremely efficiently. The outputs from
      the function provide details about the search result, including line numbers. What I like most about Us's entry is the extensive
      HTML help he has on the function. He explains all the various options <tt>grep</tt> takes and the results structure that it returns, and he includes several examples that get you started
   </p>
   <p>Thanks Us for this great utility and Yair for the recommendation!</p>
   <p><b>Comments</b></p>
   <p>If you haven't used this, give it a spin and let us know what you think <a href="http://blogs.mathworks.com/pick/?p=3576#respond">here</a> or leave a <a href="http://www.mathworks.com/matlabcentral/fileexchange/9647#comments">comment</a> for Us.
   </p>
   <p>Please keep nominating your favorite File Exchange entries <a href="http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/#respond">here</a>.
   </p><script language="JavaScript">
<!--

    function grabCode_318c1c3d03564bcaad8c1bc995be0723() {
        // 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='318c1c3d03564bcaad8c1bc995be0723 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 318c1c3d03564bcaad8c1bc995be0723';
    
        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 2012 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_318c1c3d03564bcaad8c1bc995be0723()"><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.14<br /></p>
</div>
<!--
318c1c3d03564bcaad8c1bc995be0723 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/9647 grep: a
% pedestrian, very fast grep utility> by
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/4309 Us>.
%
% This week's pick is a recommendation from
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/27420 Yair>,
% who himself is a prominent participant on MATLAB Central. Us has created
% a number of very useful functions over the years, and there's nothing
% pedestrian about his entries!
%
% This week, I was in Seattle presenting at University of Washington, and
% during the seminar I received a question about the best way to scan
% through a file for a certain text pattern that denotes the beginning of
% data. She was scanning the file line by line using
% <http://www.mathworks.com/help/matlab/ref/textscan.html |textscan|> to
% find the text of interest, and she was wondering if there was a more
% efficient way. The method she described seemed pretty reasonable.
% |textscan| is very efficient in scanning text files, and it's a good
% function for dealing with extremely large files, if you want to read them
% in chunks. Then I remembered Us's |grep|. I remembered Yair had
% <http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/#comment-14491
% suggested> it, and that there were many positive responses to the entry.
% I suggested that she take a look at the function and to use it in
% conjunction with |textscan| to do the data reading afterwards.
%
% Here's a quick example of how it works. In a folder called "data_files",
% I have 10 files, each of which contains experimental data from 100 tests.
% Each test is separated by a line indicating the test number.
%
%     Test  1
%     1.776199 
%     3.552398 
%     5.328597
%       .
%       .
%       .
%     Test  2
%     7.250518
%     4.510056
%     5.797272
%       .
%       .
%       .
%     Test  3
%       .
%       .
%       .
%
% Let's say that I want to extract data for Test 60. Because each file
% contains different number of data points, the file sizes are different.

fInfo = dir('data_files/*.txt');
s = [{fInfo.name}; num2cell([fInfo.bytes]/2^20)];
fprintf('%s: %4.1f MB\n', s{:})

%%
% To identify the lines where Test 60 starts and ends, we can look for the
% texts "Test  60" and "Test  61".

tic;
[fl, p] = grep('-u -n', {'Test  60', 'Test  61'}, 'data_files/*.txt');
disp(' '); toc;

%%
% As you can see from the comments on the File Exchange entry page, the
% function runs extremely efficiently. The outputs from the function
% provide details about the search result, including line numbers. What I
% like most about Us's entry is the extensive HTML help he has on the
% function. He explains all the various options |grep| takes and the
% results structure that it returns, and he includes several examples that
% get you started
% 
% Thanks Us for this great utility and Yair for the recommendation!
%
% *Comments*
%
% If you haven't used this, give it a spin and let us know what you think
% <http://blogs.mathworks.com/pick/?p=3576#respond here> or leave a
% <http://www.mathworks.com/matlabcentral/fileexchange/9647#comments
% comment> for Us.
%
% Please keep nominating your favorite File Exchange entries
% <http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/#respond
% here>.

##### SOURCE END ##### 318c1c3d03564bcaad8c1bc995be0723
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/m1qLimE7mwQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/05/25/grep-text-searching-utility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/05/25/grep-text-searching-utility/</feedburner:origLink></item>
		<item>
		<title>Read Medical Files</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/JQZ65R4qO9Q/</link>
		<comments>http://blogs.mathworks.com/pick/2012/05/18/read-medical-files/#comments</comments>
		<pubDate>Fri, 18 May 2012 13:41:12 +0000</pubDate>
		<dc:creator>bshoelso</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3556</guid>
		<description><![CDATA[Brett's Pick this week is the Medical Data Reader, by Dirk-Jan Kroon. When I first saw Sean de Wolski's recommendation of Dirk-Jan's suite of medical file readers for Pick-of-the-Week recognition, I kicked myself; I should have thought of that one on my own. (I'm sure I would have gotten around to it eventually, but sooner [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></introduction>
   <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/911">Brett</a>'s Pick this week is the <a href="http://www.mathworks.com/matlabcentral/fileexchange/29344">Medical Data Reader,</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/29180">Dirk-Jan Kroon</a>.
   </p>
   <p>When I first saw <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/93134">Sean de Wolski's</a> recommendation of Dirk-Jan's suite of medical file readers for Pick-of-the-Week recognition, I kicked myself; I should have
      thought of that one on my own. (I'm sure I would have gotten around to it eventually, but sooner is better--thanks for the
      suggestion, Sean. Your swag is on the way!)
   </p>
   <p>My background is in medical research, and in my role as an application engineer, I regularly have opportunities to work with
      a lot of our medically-oriented customers. The medical field is teeming with specialized data formats--many of which we don't
      have pre-packaged readers for--and I've steered users to this file numerous times since Dirk-Jan first shared it.
   </p>
   <p>When I present MATLAB to prospective users, I often point out that we provide access to low-level functions like <a href="http://www.mathworks.com/help/techdoc/ref/fopen.html"><tt>fopen</tt></a> and <a href="http://www.mathworks.com/help/techdoc/ref/fread.html"><tt>fread</tt></a>, and that the lack of a pre-built data reader should rarely (if ever) prevent anyone from analyzing their data in the MATLAB
      environment. If there's a spec available for the file, it's often not too difficult to create a custom file reader.
   </p>
   <p>Easier still, though, is finding that someone else has coded the file reader for you! In this package--one of his many
      highly-rated File Exchange submissions--Dirk-Jan provides read capabilities for file of type: DICOM ( .dcm , .dicom ), V3D
      Philips Scanner ( .v3d ), GIPL Guys Image Processing Lab ( .gipl ), HDR/IMG Analyze ( .hdr ), ISI ( .isi ) , NifTi (
      .nii ), RAW ( .raw , .* ), VMP BrainVoyager ( .vmp ), XIF HDllab/ATL ultrasound ( .xif ), VTK Visualization Toolkit
      ( .vtk ), Insight Meta-Image ( .mha, .mhd ), Micro CT ( .vff ), and PAR/REC Philips ( .par, .rec). (Note that support for
      <a href="http://www.mathworks.com/help/toolbox/images/rn/bqnw2j_-1.html#bqnw2_h-1">reading, writing, and querying DICOM files</a> is provided by the <a href="http://www.mathworks.com/help/toolbox/images/images_product_page.html">Image Processing Toolbox</a>.)
   </p>
   <p>Sean wrote of Dirk-Jan's file: "It&#8217;s reliably had a function for every file type I&#8217;ve had to work with. In addition it&#8217;s well
      written and user-friendly." Nice synopsis, Sean! And thanks for the great effort, Dirk-Jan!
   </p>
   <p>Please continue to <a href="http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/">steer us to your favorite File Exchange submissions</a> ...we'll continue to consider your recommendations for Pick-of-the-Week recognition!
   </p>
   <p>As always, <a href="http://blogs.mathworks.com/pick/?p=3556#respond">comments to this blog post</a> are welcome. Or leave a comment for Dirk-Jan <a href="http://www.mathworks.com/matlabcentral/fileexchange/29344#comments">here</a>.
   </p><script language="JavaScript">
<!--

    function grabCode_291e69aa9dd04a4d8ffb02d0a712c224() {
        // 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='291e69aa9dd04a4d8ffb02d0a712c224 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 291e69aa9dd04a4d8ffb02d0a712c224';
    
        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 2012 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_291e69aa9dd04a4d8ffb02d0a712c224()"><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.14<br /></p>
</div>
<!--
291e69aa9dd04a4d8ffb02d0a712c224 ##### SOURCE BEGIN #####
%% Read Medical Files
%% 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/911 Brett>'s Pick this week is the
% <http://www.mathworks.com/matlabcentral/fileexchange/29344 Medical Data Reader,> by 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/29180 Dirk-Jan Kroon>.

%%
% When I first saw <http://www.mathworks.com/matlabcentral/fileexchange/authors/93134 Sean de Wolski's> 
% recommendation of Dirk-Jan's suite of medical file readers for Pick-of-the-Week recognition,
% I kicked myself; I should have thought of that one on my own. (I'm sure I would have gotten around to it eventually, 
% but sooner is betterREPLACE_WITH_DASH_DASHthanks for the suggestion, Sean. Your swag is on the way!) 

%%
% My background is in medical research, and in my role as an
% application engineer, I regularly have opportunities to
% work with a lot of our medically-oriented customers. The
% medical field is teeming with specialized data formatsREPLACE_WITH_DASH_DASHmany
% of which we don't have pre-packaged readers forREPLACE_WITH_DASH_DASHand I've
% steered users to this file numerous times since
% Dirk-Jan first shared it.

%%
% When I present MATLAB to prospective users, I often point
% out that we provide access to low-level functions like
% <http://www.mathworks.com/help/techdoc/ref/fopen.html |fopen|> and <http://www.mathworks.com/help/techdoc/ref/fread.html |fread|>, and that the lack of a pre-built data
% reader should rarely (if ever) prevent anyone from
% analyzing their data in the MATLAB environment. If there's
% a spec available for the file, it's often not too
% difficult to create a custom file reader.

%%
% Easier still, though, is finding that someone else has
% coded the file reader for you! In this packageREPLACE_WITH_DASH_DASHone of his many highly-rated
% File Exchange submissionsREPLACE_WITH_DASH_DASHDirk-Jan provides read capabilities for
% file of type: DICOM ( .dcm , .dicom ), V3D Philips Scanner ( .v3d ), 
% GIPL Guys Image Processing Lab ( .gipl ), HDR/IMG Analyze ( .hdr ),
% ISI ( .isi ) , NifTi ( .nii ), RAW ( .raw , .* ),  
% VMP BrainVoyager ( .vmp ), XIF HDllab/ATL ultrasound ( .xif ), 
% VTK Visualization Toolkit ( .vtk ), Insight Meta-Image ( .mha, .mhd ), 
% Micro CT ( .vff ), and PAR/REC Philips ( .par, .rec).
% (Note that support for <http://www.mathworks.com/help/toolbox/images/rn/bqnw2j_-1.html#bqnw2_h-1 reading, writing, and querying DICOM files> 
% is provided by the <http://www.mathworks.com/help/toolbox/images/images_product_page.html Image Processing Toolbox>.) 

%%
% Sean wrote of Dirk-Jan's file: "Itâ€™s reliably had a
% function for every file type Iâ€™ve had to work with. In
% addition itâ€™s well written and user-friendly." Nice
% synopsis, Sean! And thanks for the great effort, Dirk-Jan!

%%
% Please continue to <http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/ steer us to your favorite File Exchange submissions>
% ...we'll continue to consider your recommendations for Pick-of-the-Week recognition!

%% 
% As always, <http://blogs.mathworks.com/pick/?p=3556#respond comments to this blog post> are welcome. Or leave a
% comment for Dirk-Jan
% <http://www.mathworks.com/matlabcentral/fileexchange/29344#comments here>.

##### SOURCE END ##### 291e69aa9dd04a4d8ffb02d0a712c224
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/JQZ65R4qO9Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/05/18/read-medical-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/05/18/read-medical-files/</feedburner:origLink></item>
		<item>
		<title>Multipath Fading Channel Simulation</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/GX0W4maoIMs/</link>
		<comments>http://blogs.mathworks.com/pick/2012/05/11/multipath-fading-channel-simulation-3/#comments</comments>
		<pubDate>Fri, 11 May 2012 13:59:09 +0000</pubDate>
		<dc:creator>Guest Picker</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3546</guid>
		<description><![CDATA[Idin’s pick this week is "A MATLAB-based Object-Oriented Approach to Multipath Fading Channel Simulation" by Cyril Iskander. This week’s pick is a bit different than usual. It’s not a nifty MATLAB trick or utility function. It’s not even a cool example of an application in wireless communications (my favorite industry!). It’s a white paper that [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/29096">Idin</a>’s pick this week is "<a href="http://www.mathworks.com/matlabcentral/fileexchange/18869-a-matlab-based-object-oriented-approach-to-multipath-fading-channel-simulation">A MATLAB-based Object-Oriented Approach to Multipath Fading Channel Simulation</a>" by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/30514">Cyril Iskander</a>.
<p><p>
This week’s pick is a bit different than usual. It’s not a nifty MATLAB trick or utility function. It’s not even a cool example of an application in wireless communications (my favorite industry!). It’s a white paper that outlines the theory behind one of MATLAB’s fundamental functions (well, <a href="http://www.mathworks.com/products/communications/">Communications System Toolbox</a> to be accurate). As a MathWorks applications engineer I am often asked questions about the technical details of our functions; this is one case where I have a really good answer.
<p><p>
The white paper represents one of the rare occasions where the curtain has been pulled back, and we get to see the thinking and theory that went into creating a fundamental piece of code. The paper was written in 2008 by one of the developers of MATLAB’s fading channel model, and it’s still quite relevant.
<p><p>
Multipath <a href="http://en.wikipedia.org/wiki/Fading">fading channels</a> are present in virtually all wireless communication systems, and most of the literature in this field assumes some form of a fading channel. Simulating multipath fading channels accurately and efficiently is thus critical for anyone doing either research &amp; development in the wireless industry. However, this is by no means trivial, and a great body of literature has also been dedicated to this simulation problem alone.
<p><p>
This submission does a nice job of providing the background on fading channels, surveying existing literature and techniques, and finally outlining the approach chosen for implementation of MATLAB’s multipath fading channel models (namely, filtered Gaussian noise approach). It also provides some examples of how these channel models are used in MATLAB.
<p><p>
You can find further examples and use cases of these channel models in the “demos” section of the <a href="http://www.mathworks.com/help/comm/index.html">Communications System Toolbox documentation</a>. A good example is “<a href="http://www.mathworks.com/help/comm/examples/cost-207-and-gsm-edge-channel-models.html">COST 207 and GSM/EDGE Channel Models</a>”.
<p><p>
I should note here that the same code base is also used for the Fading Channel block in Simulink. You can see examples of the Simulink block being used in most of the “Application-Specific Examples” section of the Communications System Toolbox demos. “<a href="http://www.mathworks.com/help/comm/examples/ieee-802-16-2004-ofdm-phy-link-including-space-time-block-coding-1.html">commwman80216dstbc.mdl</a>” is one such example (showing an 802.16d PHY layer simulation).
<p><p>
As always, your <a href="http://blogs.mathworks.com/pick/?p=3546#respond">comments</a> are welcomed and greatly appreciated.<img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/GX0W4maoIMs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/05/11/multipath-fading-channel-simulation-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/05/11/multipath-fading-channel-simulation-3/</feedburner:origLink></item>
		<item>
		<title>Plot Google Map</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/u1kiSL4ErmE/</link>
		<comments>http://blogs.mathworks.com/pick/2012/05/04/plot-google-map/#comments</comments>
		<pubDate>Fri, 04 May 2012 12:46:24 +0000</pubDate>
		<dc:creator>Jiro Doke</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3532</guid>
		<description><![CDATA[Jiro's pick this week is plot_google_map by Zohar Bar-Yehuda. This pick comes from Chad's response to Brett's post. He says, "plot_google_map is not only cool, it&#8217;s also very easy to use and incredibly useful for plotting spatial data." I played around with this entry and I agree. It's very easy to use; you simply call [...]]]></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/27627">plot_google_map</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/96707">Zohar Bar-Yehuda</a>.
   </p>
   <p>This pick comes from <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/225623">Chad's</a> response to <a href="http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/">Brett's post</a>. He says, "plot_google_map is not only cool, it&#8217;s also very easy to use and incredibly useful for plotting spatial data."
      I played around with this entry and I agree. It's very easy to use; you simply call the function, and it overlays a map on
      the current axes based on the latitude and longitude ranges. The part that I really like is the auto-refresh behavior, which
      automatically refreshes the map when I zoom into the map.
   </p>
   <p>Here's the driving route from our headquarter (Natick, MA) to Boston Logan Airport. You should run this and try zooming into
      the map. Download the data <a href="http://blogs.mathworks.com/images/pick/jiro/potw_plot_google_map/NatickToBOS.mat">here</a>.
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)"><span style="color: #228B22">% load route data</span>
load <span style="color: #A020F0">NatickToBOS</span>

<span style="color: #228B22">% plot route data</span>
plot(Data001(:, 1), Data001(:, 2), <span style="color: #A020F0">'r'</span>, <span style="color: #A020F0">'LineWidth'</span>, 2);
line(Data001(1, 1), Data001(1, 2), <span style="color: #A020F0">'Marker'</span>, <span style="color: #A020F0">'o'</span>, <span style="color: #0000FF">...</span>
    <span style="color: #A020F0">'Color'</span>, <span style="color: #A020F0">'b'</span>, <span style="color: #A020F0">'MarkerFaceColor'</span>, <span style="color: #A020F0">'b'</span>, <span style="color: #A020F0">'MarkerSize'</span>, 10);
line(Data001(end, 1), Data001(end, 2), <span style="color: #A020F0">'Marker'</span>, <span style="color: #A020F0">'s'</span>, <span style="color: #0000FF">...</span>
    <span style="color: #A020F0">'Color'</span>, <span style="color: #A020F0">'b'</span>, <span style="color: #A020F0">'MarkerFaceColor'</span>, <span style="color: #A020F0">'b'</span>, <span style="color: #A020F0">'MarkerSize'</span>, 10);
xlim([-71.4, -71]); axis <span style="color: #A020F0">equal</span> <span style="color: #A020F0">off</span>

<span style="color: #228B22">% Google map</span>
plot_google_map(<span style="color: #A020F0">'maptype'</span>, <span style="color: #A020F0">'roadmap'</span>);</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/jiro/potw_plot_google_map/potw_plot_google_map_01.png"> <p>One suggestion I have is to add the auto-refresh behavior for panning, in addition to zooming. It's very simple to do that.
      There's a section in the code that implements this for the zoom action:
   </p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">zoomHandle = zoom;
set(zoomHandle, <span style="color: #A020F0">'ActionPostCallback'</span>, @update_google_map);</pre><p>You can do the same thing for the pan action like this:</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">panHandle = pan;
set(panHandle, <span style="color: #A020F0">'ActionPostCallback'</span>, @update_google_map);</pre><p>With this, if you pan the map, the graphics will update after releasing the mouse.</p>
   <p>Thanks Zohar for the entry and Chad for the recommendation!</p>
   <p><b>Comments</b></p>
   <p>Give this a try and let us know what you think <a href="http://blogs.mathworks.com/pick/?p=3532#respond">here</a> or leave a <a href="http://www.mathworks.com/matlabcentral/fileexchange/27627#comments">comment</a> for Zohar.
   </p><script language="JavaScript">
<!--

    function grabCode_84a0d9f3331042a6913112114f1c23c5() {
        // 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='84a0d9f3331042a6913112114f1c23c5 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 84a0d9f3331042a6913112114f1c23c5';
    
        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 2012 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_84a0d9f3331042a6913112114f1c23c5()"><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.14<br /></p>
</div>
<!--
84a0d9f3331042a6913112114f1c23c5 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/27627
% plot_google_map> by
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/96707 Zohar
% Bar-Yehuda>.
%
% This pick comes from
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/225623
% Chad's> response to
% <http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/
% Brett's post>. He says, "plot_google_map is not only cool, itâ€™s also very
% easy to use and incredibly useful for plotting spatial data." I played
% around with this entry and I agree. It's very easy to use; you simply
% call the function, and it overlays a map on the current axes based on the
% latitude and longitude ranges. The part that I really like is the
% auto-refresh behavior, which automatically refreshes the map when I zoom
% into the map.
%
% Here's the driving route from our headquarter (Natick, MA) to Boston
% Logan Airport. You should run this and try zooming into the map. Download
% the data
% <http://blogs.mathworks.com/images/pick/jiro/potw_plot_google_map/NatickToBOS.mat
% here>.

% load route data
load NatickToBOS

% plot route data
plot(Data001(:, 1), Data001(:, 2), 'r', 'LineWidth', 2);
line(Data001(1, 1), Data001(1, 2), 'Marker', 'o', ...
    'Color', 'b', 'MarkerFaceColor', 'b', 'MarkerSize', 10);
line(Data001(end, 1), Data001(end, 2), 'Marker', 's', ...
    'Color', 'b', 'MarkerFaceColor', 'b', 'MarkerSize', 10);
xlim([-71.4, -71]); axis equal off

% Google map
plot_google_map('maptype', 'roadmap');

%%
% One suggestion I have is to add the auto-refresh behavior for panning, in
% addition to zooming. It's very simple to do that. There's a section in
% the code that implements this for the zoom action:
%
%   zoomHandle = zoom;
%   set(zoomHandle, 'ActionPostCallback', @update_google_map);
%
% You can do the same thing for the pan action like this:
%
%   panHandle = pan;
%   set(panHandle, 'ActionPostCallback', @update_google_map);
%
% With this, if you pan the map, the graphics will update after releasing
% the mouse.
%
% Thanks Zohar for the entry and Chad for the recommendation! 
%
% *Comments*
%
% Give this a try and let us know what you think
% <http://blogs.mathworks.com/pick/?p=3532#respond here> or leave a
% <http://www.mathworks.com/matlabcentral/fileexchange/27627#comments
% comment> for Zohar.

##### SOURCE END ##### 84a0d9f3331042a6913112114f1c23c5
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/u1kiSL4ErmE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/05/04/plot-google-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/05/04/plot-google-map/</feedburner:origLink></item>
		<item>
		<title>Calculating arclengths…made easy!</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/JQ3Gql9Nv4M/</link>
		<comments>http://blogs.mathworks.com/pick/2012/04/27/calculating-arclengths-made-easy/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 13:11:08 +0000</pubDate>
		<dc:creator>bshoelso</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3506</guid>
		<description><![CDATA[Brett's Pick this week is Arclength, by John D'Errico. First, a nod (and some MATLAB swag!) to Frank Engel, who steered us to John's awesome code! We recently asked users to nominate their favorite File Exchange contributions and Frank jumped in quickly to steer us to Arclength. How timely! For a medical image processing seminar [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></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/34871">Arclength,</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/679">John D'Errico</a>.
   </p>
   <p>First, a nod (and some MATLAB swag!) to <a href="https://sites.google.com/site/engelgeography/">Frank Engel</a>, who steered us to John's awesome code! We recently asked users to <a href="http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission">nominate their favorite File Exchange contributions</a> and Frank jumped in quickly to steer us to Arclength.
   </p>
   <p>How timely! For a medical image processing seminar I recently put together, I wanted to measure the <a href="http://en.wikipedia.org/wiki/Tortuosity">tortuosity</a> of blood vessels. Defining tortuosity as the ratio of arclength to endpoint distance, I segmented an image of the retinal
      vasculature, <a href="http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwmorph.html">skeletonized</a> the image, and broke the vessels into sub-units after detecting <a href="http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwmorph.html">branch points</a>, and then sought to measure the length of the sub-units.
   </p>
   <p>After working on the problem for a while, I came up with two reliable methods--after a few misfires. For my first attempt,
      I sought to reorient vessel segments so that there were no repeated "x-values," and to fit and calculate the length of splines.
      That approach was unwieldy, and yielded poor results. After playing around some more, I found a couple of reliable, robust
      approaches. First, I used <a href="http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/regionprops.html"><tt>regionprops</tt></a> to measure the perimeters of the segments, and divided that value by two--works like a charm, since the vessels were skeletonized.
      Next, I isolated vessel segments using <a href="http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwlabel.html"><tt>bwlabel</tt></a>, and then calculated the maximum of the <a href="http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwdistgeodesic.html"><tt>bwdistgeodesic</tt></a> (geodesic distance transform). Another success!
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/files/Retina.png"> </p>
   <p>John's approach helped me to see where I went astray on my first misguided attempt, and made the solution easy:</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">img = imread(<span style="color: #A020F0">'seg10.png'</span>);
<span style="color: #228B22">%imshow(img);</span></pre><p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/files/seg10.png"> </p>
   <p>Here are three approaches:</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)"><span style="color: #228B22">% Perimeter:</span>
perim = regionprops(img,<span style="color: #A020F0">'Perimeter'</span>);
perim = perim.Perimeter/2

<span style="color: #228B22">% Geodesic Distance Transform:</span>
[r,c] = find(bwmorph(img,<span style="color: #A020F0">'endpoints'</span>));
gdt = max(max(bwdistgeodesic(img,c(1),r(1),<span style="color: #A020F0">'quasi-euclidean'</span>)))

<span style="color: #228B22">% John's arclength:</span>
pts = regionprops(img,<span style="color: #A020F0">'pixellist'</span>);
pts = [pts.PixelList];
vessellength = arclength(pts(:,1),pts(:,2))</pre><pre style="font-style:oblique">perim =
       74.527
gdt =
       74.527
vessellength =
       74.527
</pre><p>So it appears that all of these approaches work, and isn't it nice to have options? John's code is particularly useful even
      if your x-y- coordinates aren't necessarily extracted from an image. And because he breaks his path "into a series of integrals
      between each pair of breaks on the curve," he avoids the problems I had trying to fit a continuous spline to a rotated set
      of coordinates.
   </p>
   <p>Very nice, John. And thanks for the note, Frank. Swag on the way to both of you!</p>
   <p>Keep those suggestions coming. This makes my job a lot easier! :)</p>
   <p>As always, <a href="http://blogs.mathworks.com/pick/?p=3506#respond">comments to this blog post</a> are welcome. Or leave a comment for John <a href="http://www.mathworks.com/matlabcentral/fileexchange/34871#comments">here</a>.
   </p><script language="JavaScript">
<!--

    function grabCode_2829b231d6f74f6fba84870c077f55eb() {
        // 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='2829b231d6f74f6fba84870c077f55eb ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 2829b231d6f74f6fba84870c077f55eb';
    
        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 2012 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_2829b231d6f74f6fba84870c077f55eb()"><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.14<br /></p>
</div>
<!--
2829b231d6f74f6fba84870c077f55eb ##### SOURCE BEGIN #####
%% Arclengths made easy!
%% 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/911 Brett>'s Pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/34871 Arclength,> by 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/679 John D'Errico>.

%%
% First, a nod (and some MATLAB swag!) to <https://sites.google.com/site/engelgeography/ Frank Engel>, who steered us
% to John's awesome code! We recently asked users to
% <http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission nominate their favorite File Exchange contributions> 
% and Frank jumped in quickly to steer us to Arclength.

%%
% How timely! For a medical image processing seminar I
% recently put together, I wanted to measure the <http://en.wikipedia.org/wiki/Tortuosity tortuosity>
% of blood vessels. Defining tortuosity as the ratio of arclength to endpoint distance, I segmented an image of the retinal
% vasculature, <http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwmorph.html skeletonized> the image, and broke the vessels into sub-units after
% detecting <http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwmorph.html branch points>,
% and then sought to measure the length of the sub-units.

%% 
% After working on the problem for a while, I came up with
% two reliable methodsREPLACE_WITH_DASH_DASHafter a few misfires. For my first attempt, I sought to reorient vessel segments
% so that there were no repeated "x-values," and to fit and calculate the length of splines.
% That approach was unwieldy, and yielded poor results. After playing around some more, I found a couple of reliable, robust approaches.
% First, I used 
% <http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/regionprops.html |regionprops|> to measure 
% the perimeters of the segments, and divided that value by twoREPLACE_WITH_DASH_DASHworks like a charm, since the vessels were skeletonized.
% Next, I isolated vessel segments using 
% <http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwlabel.html |bwlabel|>, and then calculated the maximum of the <http://www.mathworks.com/help/releases/R2012a/toolbox/images/ref/bwdistgeodesic.html |bwdistgeodesic|> 
% (geodesic distance transform). Another success! 

%%
% 
% <<http://blogs.mathworks.com/pick/files/Retina.png>>
% 

%% 
% John's approach helped me to see where I went astray on my first misguided attempt,
% and made the solution easy:

img = imread('seg10.png');
%imshow(img);
%%
% 
% <<http://blogs.mathworks.com/pick/files/seg10.png>>
% 

%%
% Here are three approaches:


% Perimeter:
perim = regionprops(img,'Perimeter');
perim = perim.Perimeter/2

% Geodesic Distance Transform:
[r,c] = find(bwmorph(img,'endpoints'));
gdt = max(max(bwdistgeodesic(img,c(1),r(1),'quasi-euclidean')))

% John's arclength:
pts = regionprops(img,'pixellist');
pts = [pts.PixelList];
vessellength = arclength(pts(:,1),pts(:,2))


%%
% So it appears that all of these approaches work, and isn't
% it nice to have options? John's code is particularly
% useful even if your x-y- coordinates aren't necessarily
% extracted from an image. And because he breaks his path
% "into a series of integrals between each pair of breaks on the curve," he avoids the problems I had 
% trying to fit a continuous spline to a rotated set of coordinates.

%%
% Very nice, John. And thanks for the note, Frank. Swag on the way to both of you!

%%
% Keep those suggestions coming. This makes my job a lot
% easier! :)

%% 
% As always, <http://blogs.mathworks.com/pick/?p=3506#respond comments to this blog post> are welcome. Or leave a
% comment for John
% <http://www.mathworks.com/matlabcentral/fileexchange/34871#comments here>.

##### SOURCE END ##### 2829b231d6f74f6fba84870c077f55eb
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/JQ3Gql9Nv4M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/04/27/calculating-arclengths-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/04/27/calculating-arclengths-made-easy/</feedburner:origLink></item>
		<item>
		<title>Run on Target Hardware</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/T9J_1QOtFMU/</link>
		<comments>http://blogs.mathworks.com/pick/2012/04/20/run-on-target-hardware/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 12:57:34 +0000</pubDate>
		<dc:creator>Guest Picker</dc:creator>
				<category><![CDATA[Picks]]></category>
		<category><![CDATA[Simulink]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3471</guid>
		<description><![CDATA[Doug's picks this week are Simulink Support Packages for LEGO MINDSTORMS NXT [link], Beagleboard [link], Arduino Uno [link], and Arduino Mega [link] by the Classroom Resources Team. This week, I'd like to highlight a new feature in the R2012a release of Simulink called Run on Target Hardware. You may remember back in November 2010 Greg [...]]]></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/62957">Doug</a>'s picks this week are Simulink Support Packages for LEGO MINDSTORMS NXT [<a href="http://www.mathworks.com/matlabcentral/fileexchange/35206-simulink-support-package-for-lego-mindstorms-nxt-hardware">link</a>], Beagleboard [<a href="http://www.mathworks.com/matlabcentral/fileexchange/35205-simulink-support-package-for-beagleboard-hardware">link</a>], Arduino Uno [<a href="http://www.mathworks.com/matlabcentral/fileexchange/35639-simulink-support-package-for-arduino-uno-hardware">link</a>], and Arduino Mega [<a href="http://www.mathworks.com/matlabcentral/fileexchange/35641-simulink-support-package-for-arduino-mega-hardware">link</a>] by the <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/68228">Classroom Resources Team</a>.</p>

<p>This week, I'd like to highlight a new feature in the R2012a release of Simulink called <a href="http://www.mathworks.com/products/simulink/simulink-targets/">Run on Target Hardware</a>.</p>

<p>You may remember back in <a href="http://blogs.mathworks.com/pick/2010/11/5/deploy-auto-generated-c-code-from-simulink-to-arduino-development-board/">November 2010</a> <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/32620">Greg Wolff</a> highlighted my <a href="http://www.mathworks.com/matlabcentral/fileexchange/24675-arduino-target">Arduino Target</a> submission that let you run a Simulink model on an <a href="http://www.arduino.cc/">Arduino</a> Deumilanove by leveraging <a href="http://www.mathworks.com/products/simulink-coder/">Simulink Coder</a> and <a href="http://www.mathworks.com/products/embedded-coder/">Embedded Coder</a> to convert the model to C code.

<p>So what's different about this new Run on Target Hardware capability? Well starting in R2012a you can now run your Simulink models on hardware even if you do not have Simulink Coder or Embedded Coder. That means that even those of you using the <a href="http://www.mathworks.com/academia/student_version/">Student Version</a> can take advantage of this capability! Run on Target Hardware currently supports the Uno and Mega varieties of the Arduino as well as the <a href="http://beagleboard.org/hardware-xM">BeagleBoard-xM</a> and <a href="http://mindstorms.lego.com/en-us/whatisnxt/default.aspx">LEGO MINDSTORMS NXT</a>.</p>

<p>While there are File Exchange submissions for the supported hardware targets, you should install them directly from MATLAB by typing "targetinstaller" at the command prompt. This brings up a tool that automates the download and install process. Watch the video below to see it in action:</p>

<p><a href="http://www.mathworks.com/products/simulink/simulink-targets/videos/introduction-to-simulink-support-for-target-hardware.html" rel="shadowbox;width=935;height=632"><img class="margin_bottom_5" src="http://www.mathworks.com/products/simulink/simulink-targets/videos/introduction-to-simulink-support-for-target-hardware-thumb.jpg" alt="Video: Introduction to Simulink Support for Target Hardware" title="" /></a><br /><a href="http://www.mathworks.com/products/simulink/simulink-targets/videos/introduction-to-simulink-support-for-target-hardware.html" rel="shadowbox;width=935;height=632">Introduction to Simulink Support for Target Hardware</a> <span class="de_emphasize">1:57</span> </p>

If you do have Simulink Coder and Embedded Coder, the original target is still available and is known as the <a href="http://www.mathworks.com/matlabcentral/fileexchange/30277-embedded-coder-support-package-for-arduino">Embedded Coder Support Package for Arduino</a>. It supports the ability to do processor-in-the-loop simulations. For more information on the different ways Arduino is supported with MATLAB and Simulink see <a href="http://www.mathworks.com/support/solutions/en/data/1-HCE464/index.html">this solution page</a>.</p>

<p><b>Comments</b></p>

<p>We can't wait to see what kind of interesting projects you come up with by taking advantage of this capability. Please check it out and let us know what you think <a href="http://blogs.mathworks.com/pick/?p=3471#respond">here</a>.</p>

</div><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/T9J_1QOtFMU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/04/20/run-on-target-hardware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/04/20/run-on-target-hardware/</feedburner:origLink></item>
		<item>
		<title>What is your favorite unrecognized File Exchange submission?</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/vz4fjh1xQz4/</link>
		<comments>http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 12:49:25 +0000</pubDate>
		<dc:creator>bshoelso</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3445</guid>
		<description><![CDATA[Contents You make the call! A couple ground rules. This week, instead of Picking one of my favorite files, I'm going to solicit your suggestions for Pickworthy files. Except on rare occasions, I tend to select submissions that are useful to my own workflows. But I recognize that many of you use MATLAB and Simulink [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></introduction>
   <h3>Contents</h3>
   <div>
      <ul>
         <li><a href="#2">You make the call!</a></li>
         <li><a href="#3">A couple ground rules.</a></li>
      </ul>
   </div>
   <p>This week, instead of Picking one of my favorite files, I'm going to solicit your suggestions for Pickworthy files. Except
      on rare occasions, I tend to select submissions that are useful to my own workflows. But I recognize that many of you use
      MATLAB and Simulink differently than I do, and in different fields. So here's your chance to recognize something that you
      particularly like.
   </p>
   <h3>You make the call!<a name="2"></a></h3>
   <p>Respond to this post with suggestions for future Picks. What have you found most useful? Perhaps you've found some overlooked
      gems? Something you think would have broad appeal, if they only knew about it? And if Jiro or I end up
      selecting a file as a Pick of the Week based on your suggestion, we'll send you some cool MATLAB swag!
   </p>
   <h3>A couple ground rules.<a name="3"></a></h3>
   <div>
      <ul>
         <li>Please don't steer to your own file. (We may have another round of this later, in which we allow contributors to nominate
            their own files, but for this round, let's focus on recognizing the work of our fellow MATLAB or Simulink fans.)
         </li>
         <li>Please only suggest files that are covered under the BSD!</li>
         <li>Submissions should be exemplary for some reason that you can point out. Is it just beautifully written? Have you   found
            it exceptionally useful? Great use of visual   elements? (Tell us what it was that led you to select   a particular file.
            We may even quote you!)
         </li>
         <li>Your nomination constitutes your acknowledgment that we may quote you, and your permission to do so.</li>
         <li>Please don't suggest any files that have already been Picked. (All previous Picks of the Week are tagged on their entries
            with a POTW stamp.)
         </li>
         <li>Remember: cool MATLAB swag to anyone who steers us to a file we use!</li>
         <li>Please direct your correspondences to the <a href="http://blogs.mathworks.com/pick/?p=3445#respond">comments</a> section of this post.
         </li>
         <li>Happy hunting!</li>
         <li>Sorry, one more rule: we're only going to consider files that don't use undocumented functionality.</li>
      </ul>
   </div>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/files/MATLAB_logo_small.png"> </p><script language="JavaScript">
<!--

    function grabCode_3f428800d46746d9b5d6fc7848477529() {
        // 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='3f428800d46746d9b5d6fc7848477529 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 3f428800d46746d9b5d6fc7848477529';
    
        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 2012 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_3f428800d46746d9b5d6fc7848477529()"><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.14<br /></p>
</div>
<!--
3f428800d46746d9b5d6fc7848477529 ##### SOURCE BEGIN #####
%% What is your favorite unrecognized File Exchange submission?
%% 
% This week, instead of Picking one of my favorite files,
% I'm going to solicit your suggestions for Pickworthy files. Except on
% rare occasions, I tend to select submissions that are
% useful to my own workflows. But I recognize that many of
% you use MATLAB and Simulink differently than I do, and in
% different fields. So here's your chance to recognize
% something that you particularly like.

%% You make the call!
% Respond to this Post with suggestions for future Picks.
% What have you found most useful? Perhaps you've found some
% overlooked gems? Something you think would have broad
% appeal, if they only knew about it? And if Jiro or I agree
% with you,  and end up selecting a file as a Pick of the
% Week based on your suggestion, we'll send you some cool
% MATLAB swag!

%% A couple ground rules.
% 
% * Please don't steer to your own file. (We may have
% another round of this later, in which we allow
% contributors to nominate their own files, but for this
% round, let's focus on other recognizing the work of our fellow MATLAB or Simulink fans.)
% * Please only suggest files that are covered under the BSD!
% * Submissions should be exemplary for some reason that you
%   can point out. Is it just beautifully written? Have you
%   found it exceptionally useful? Great use of visual
%   elements? (Tell us what it was that led you to select
%   a particular file. We may even quote you!)
% * Your nomination constitutes your acknowledgment that we
% may quote you, and your permission to do so. 
% * Please don't suggest any files that have already been
% Picked. (All previous Picks of the Week are tagged on
% their entries with a POTW stamp.)
% * Remember: cool MATLAB swag to anyone who steers us to a
% file we use!
% * Please direct your correspondences to the <http://blogs.mathworks.com/pick/?p=3445#respond comments>
% section of this post.
% * Happy hunting!
% * Sorry, one more rule: we're only going to consider files that don't use undocumented functionality.

%%
% 
% <<http://blogs.mathworks.com/pick/files/MATLAB_logo_small.png>>
% 
##### SOURCE END ##### 3f428800d46746d9b5d6fc7848477529
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/vz4fjh1xQz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/04/13/what-is-your-favorite-unrecognized-file-exchange-submission/</feedburner:origLink></item>
		<item>
		<title>Autostereogram</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/irCA_V3aByo/</link>
		<comments>http://blogs.mathworks.com/pick/2012/04/06/autostereogram/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 12:57:18 +0000</pubDate>
		<dc:creator>Jiro Doke</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3438</guid>
		<description><![CDATA[Jiro's pick this week is abSIRD by Daniel Armyr. Here's a fun pick for the week. This function takes a matrix, representing a height-map, and visualizes it using an Autostereogram. To quote Daniel, "the algorithm used is abSIRD, published in 2004 by Lewey Geselowitz. It is a fast, in-place algorithm that is exquisitely simple to [...]]]></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/27649">abSIRD</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/25696">Daniel Armyr</a>.
   </p>
   <p>Here's a fun pick for the week. This function takes a matrix, representing a height-map, and visualizes it using an <a href="http://en.wikipedia.org/wiki/Autostereogram">Autostereogram</a>. To quote Daniel, "the algorithm used is abSIRD, published in 2004 by Lewey Geselowitz. It is a fast, in-place algorithm
      that is exquisitely simple to implement."
   </p>
   <p>Can you see them? Hint: cross your eyes.</p><pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">m = membrane(1, 250, 9, 2);
makeAbsird(m);</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/jiro/potw_absird/potw_absird_01.png"> <pre style="background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)">p = load(<span style="color: #A020F0">'penny'</span>);

<span style="color: #228B22">% Make it 4 times bigger (imresize from Image Processing Toolbox)</span>
p2 = imresize(p.P, 4);

makeAbsird(p2);</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/jiro/potw_absird/potw_absird_02.png"> <p>What a great way to visualize 3D data!</p>
   <p>I like this entry not only for the coolness factor, but also for how it is written. The code is robustly written with error
      checking and plenty of comments to describe the algorithm. I also like the <a href="http://www.mathworks.com/matlabcentral/fileexchange/27649-absird-for-matlab/content/html/testMakeAbsird.html">published example code</a> that he included with the entry. These files can be easily created using MATLAB's <a href="http://www.mathworks.com/help/matlab/matlab_env/overview-of-publishing-matlab-code.html">publishing</a> capability, and it's a great way of showing how to use your code or explaining concepts. I especially like them when they
      are used with File Exchange entries.
   </p>
   <p><b>Comments</b></p>
   <p>Give this function a try (and cross your eyes) and let us know what you think <a href="http://blogs.mathworks.com/pick/?p=3438#respond">here</a> or leave a <a href="http://www.mathworks.com/matlabcentral/fileexchange/27649#comments">comment</a> for Daniel.
   </p><script language="JavaScript">
<!--

    function grabCode_175915dab4fa41fc8abf199ee60f7ebb() {
        // 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='175915dab4fa41fc8abf199ee60f7ebb ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 175915dab4fa41fc8abf199ee60f7ebb';
    
        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 2012 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_175915dab4fa41fc8abf199ee60f7ebb()"><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.14<br /></p>
</div>
<!--
175915dab4fa41fc8abf199ee60f7ebb ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/27649 abSIRD> by
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/25696 Daniel
% Armyr>.
%
% Here's a fun pick for the week. This function takes a matrix,
% representing a height-map, and visualizes it using an
% <http://en.wikipedia.org/wiki/Autostereogram Autostereogram>. To quote
% Daniel, "the algorithm used is abSIRD, published in 2004 by Lewey
% Geselowitz. It is a fast, in-place algorithm that is exquisitely simple
% to implement."
%
% Can you see them? Hint: cross your eyes.

m = membrane(1, 250, 9, 2);
makeAbsird(m);

%%
p = load('penny');

% Make it 4 times bigger (imresize from Image Processing Toolbox)
p2 = imresize(p.P, 4); 

makeAbsird(p2);

%%
% What a great way to visualize 3D data!
%
% I like this entry not only for the coolness factor, but also for how it
% is written. The code is robustly written with error checking and plenty
% of comments to describe the algorithm. I also like the
% <http://www.mathworks.com/matlabcentral/fileexchange/27649-absird-for-matlab/content/html/testMakeAbsird.html
% published example code> that he included with the entry. These files can
% be easily created using MATLAB's
% <http://www.mathworks.com/help/matlab/matlab_env/overview-of-publishing-matlab-code.html
% publishing> capability, and it's a great way of showing how to use your
% code or explaining concepts. I especially like them when they are used
% with File Exchange entries.
%
% *Comments*
%
% Give this function a try (and cross your eyes) and let us know what you
% think <http://blogs.mathworks.com/pick/?p=3438#respond here> or leave a
% <http://www.mathworks.com/matlabcentral/fileexchange/27649#comments
% comment> for Daniel.

##### SOURCE END ##### 175915dab4fa41fc8abf199ee60f7ebb
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/irCA_V3aByo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/04/06/autostereogram/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/04/06/autostereogram/</feedburner:origLink></item>
		<item>
		<title>Archimedes’s Computation of Pi</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/S7dL4XRKcMI/</link>
		<comments>http://blogs.mathworks.com/pick/2012/03/30/archimedess-computation-of-pi/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 13:12:09 +0000</pubDate>
		<dc:creator>bshoelso</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3419</guid>
		<description><![CDATA[Brett's Pick this week is The Computation of Pi by Archimedes, by Bill McKeeman. In the comments to Bill's post, long-time File Exchange champion John D'Errico wrote: "There are two uses for the File Exchange that I love. One is to provide high quality code. The second is to teach others about some interesting part [...]]]></description>
			<content:encoded><![CDATA[<div xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" class="content">
   <introduction></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/29504">The Computation of Pi by Archimedes,</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/117137">Bill McKeeman</a>.
   </p>
   <p>In the comments to Bill's post, long-time File Exchange champion John D'Errico wrote: "There are two uses for the File Exchange
      that I love. One is to provide high quality code. The second is to teach others about some interesting part of mathematics
      and hopefully, write it using well written MATLAB code. This submission eminently qualifies. You can read it and learn something
      from what Bill has done."
   </p>
   <p>I wholeheartedly agree with John about the value of Bill's post. In this submission, retired MathWorks Fellow (and current
      (?) Dartmouth adjunct faculty member) Bill provides a beautifully presented explanation of Archimedes's attempt to measure
      pi by calculating the circumferences of regularly polygons bounding the inside and outside of a circle:
   </p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/pick/files/HexPi.jpg"> </p>
   <p>Then, by successively increasing the number of sides of those polygons, Archimedes iterated to a more accurate value of pi
      than had been obtained to date.
   </p>
   <p>Besides making a fascinating read, Bill's presentation of this material provides a really nice demonstration of using HTML
      to show mathematics-intensive text. Once rendered using MATLAB's built-in <a href="http://www.mathworks.com/help/releases/R2012a/techdoc/matlab_env/f6-30186.html">publishing</a> capabilities, you end up with a <a href="http://www.mathworks.com/matlabcentral/fileexchange/29504-the-computation-of-pi-by-archimedes/content/html/ComputationOfPiByArchimedes.html">beautifully formatted report</a>.
   </p>
   <p>As always, <a href="http://blogs.mathworks.com/pick/?p=3419#respond">comments to this blog post</a> are welcome. Or leave a comment for Bill <a href="http://www.mathworks.com/matlabcentral/fileexchange/29504#comments">here</a>.
   </p><script language="JavaScript">
<!--

    function grabCode_31077bdbf524431e9bff42db78627675() {
        // 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='31077bdbf524431e9bff42db78627675 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 31077bdbf524431e9bff42db78627675';
    
        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 2012 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_31077bdbf524431e9bff42db78627675()"><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.14<br /></p>
</div>
<!--
31077bdbf524431e9bff42db78627675 ##### SOURCE BEGIN #####
%% Archimedes's Computation of Pi
%% 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/911 Brett>'s Pick this week is
% <http://www.mathworks.com/matlabcentral/fileexchange/29504 The Computation of Pi by Archimedes,> by 
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/117137 Bill McKeeman>.

%%
% In the comments to Bill's post, long-time File Exchange
% champion John D'Errico wrote: "There are two uses for the
% File Exchange that I love. One is to provide high quality
% code. The second is to teach others about some interesting
% part of mathematics and hopefully, write it using well
% written MATLAB code. This submission eminently qualifies.
% You can read it and learn something from what Bill has
% done."

%%
% I wholeheartedly agree with John about the value of Bill's
% post. In this submission, retired MathWorks Fellow (and
% current (?) Dartmouth adjunct faculty member) Bill provides
% a beautifully presented explanation of Archimedes's
% attempt to measure pi by calculating the circumferences
% of regularly polygons bounding the inside and outside of a
% circle:

%%
% 
% <<http://blogs.mathworks.com/pick/files/HexPi.jpg>>
% 

%%
% Then, by successively increasing the number of
% sides of those polygons, Archimedes iterated to a more
% accurate value of pi than had been obtained to date.

%%
% Besides making a fascinating read, Bill's presentation of
% this material provides a really nice demonstration of
% using HTML to show mathematics-intensive text. Once
% rendered using MATLAB's built-in <http://www.mathworks.com/help/releases/R2012a/techdoc/matlab_env/f6-30186.html publishing> capabilities, you end up
% with a <http://www.mathworks.com/matlabcentral/fileexchange/29504-the-computation-of-pi-by-archimedes/content/html/ComputationOfPiByArchimedes.html beautifully formatted report>.

%% 
% As always, <http://blogs.mathworks.com/pick/?p=3419#respond comments to this blog post> are welcome. Or leave a
% comment for Bill
% <http://www.mathworks.com/matlabcentral/fileexchange/29504#comments here>.
##### SOURCE END ##### 31077bdbf524431e9bff42db78627675
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/S7dL4XRKcMI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/03/30/archimedess-computation-of-pi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/03/30/archimedess-computation-of-pi/</feedburner:origLink></item>
		<item>
		<title>MATLAB Plot Gallery</title>
		<link>http://feedproxy.google.com/~r/mathworks/pick/~3/IsSw1rz9xN8/</link>
		<comments>http://blogs.mathworks.com/pick/2012/03/23/matlab-plot-gallery/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 14:17:31 +0000</pubDate>
		<dc:creator>Jiro Doke</dc:creator>
				<category><![CDATA[Picks]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/pick/?p=3411</guid>
		<description><![CDATA[Jiro's pick this week is the MATLAB Plot Gallery by Plot Gallery. This week, I'd like to introduce a new page on our MathWorks website - the MATLAB Plot Gallery. MATLAB Plot Gallery is a visually-indexed page of various examples of graphical techniques in MATLAB. Hovering over the thumbnails will show you a larger preview [...]]]></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 the <a href="http://www.mathworks.com/discovery/gallery.html">MATLAB Plot Gallery</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/196102">Plot Gallery</a>.
   </p>
   <p>This week, I'd like to introduce a new page on our MathWorks website - the MATLAB Plot Gallery.</p>
   <p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/images/pick/jiro/potw_plotgallery/plotgallery_sc.png"> </p>
   <p>MATLAB Plot Gallery is a visually-indexed page of various examples of graphical techniques in MATLAB. Hovering over the thumbnails
      will show you a larger preview of the plot. When you click on the thumbnails, it takes you to the corresponding <a href="http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid:196102">File Exchange entries</a> where you can view and download the MATLAB code.
   </p>
   <p>The aim of the gallery is to give existing users quick access to example code snippets of different plotting techniques, and
      to give potential users an idea of what's capable in MATLAB for graphics. Currently, the gallery only contains basic plot
      types, customization commands, and some advanced techniques in core MATLAB. The plan is to increase the number of examples,
      including more advanced and application-specific visualizations.
   </p>
   <p><b>Comments</b></p>
   <p>Please check it out and let us know what you think <a href="http://blogs.mathworks.com/pick/?p=3411#respond">here</a>. Also, let us know what other types of visualization examples you would like to see.
   </p><script language="JavaScript">
<!--

    function grabCode_4d916092db9644ad9f4abf558302fac0() {
        // 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='4d916092db9644ad9f4abf558302fac0 ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' 4d916092db9644ad9f4abf558302fac0';
    
        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 2012 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_4d916092db9644ad9f4abf558302fac0()"><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.14<br /></p>
</div>
<!--
4d916092db9644ad9f4abf558302fac0 ##### SOURCE BEGIN #####
%%
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/15007
% Jiro>'s pick this week is the
% <http://www.mathworks.com/discovery/gallery.html MATLAB Plot Gallery> by
% <http://www.mathworks.com/matlabcentral/fileexchange/authors/196102 Plot
% Gallery>.
%
% This week, I'd like to introduce a new page on our MathWorks website -
% the MATLAB Plot Gallery. 
%
% <<plotgallery_sc.png>>
%
% MATLAB Plot Gallery is a visually-indexed page of various examples of
% graphical techniques in MATLAB. Hovering over the thumbnails will show
% you a larger preview of the plot. When you click on the thumbnails, it
% takes you to the corresponding
% <http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid:196102
% File Exchange entries> where you can view and download the MATLAB code.
%
% The aim of the gallery is to give existing users quick access to example
% code snippets of different plotting techniques, and to give potential
% users an idea of what's capable in MATLAB for graphics. Currently, the
% gallery only contains basic plot types, customization commands, and some
% advanced techniques in core MATLAB. The plan is to increase the number of
% examples, including more advanced and application-specific
% visualizations.
%
% *Comments*
%
% Please check it out and let us know what you think
% <http://blogs.mathworks.com/pick/?p=3411#respond here>. Also, let us know
% what other types of visualization examples you would like to see.
##### SOURCE END ##### 4d916092db9644ad9f4abf558302fac0
--><img src="http://feeds.feedburner.com/~r/mathworks/pick/~4/IsSw1rz9xN8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/pick/2012/03/23/matlab-plot-gallery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blogs.mathworks.com/pick/2012/03/23/matlab-plot-gallery/</feedburner:origLink></item>
	</channel>
</rss>

