<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MATLAB Spoken Here</title>
	<atom:link href="http://blogs.mathworks.com/community/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/community</link>
	<description>News from the intersection of MATLAB, Community, and the web.</description>
	<lastBuildDate>Wed, 08 May 2013 13:53:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Data Tips on MATLAB Mobile</title>
		<link>http://blogs.mathworks.com/community/2013/05/01/data-tips-on-matlab-mobile/</link>
		<comments>http://blogs.mathworks.com/community/2013/05/01/data-tips-on-matlab-mobile/#comments</comments>
		<pubDate>Wed, 01 May 2013 14:15:38 +0000</pubDate>
		<dc:creator>Pradeep Ramamoorthy</dc:creator>
				<category><![CDATA[MATLAB Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2222</guid>
		<description><![CDATA[It has been a while since we last talked about displaying data tips on MATLAB Mobile. The data cursor feature has since then evolved from tap-and-hold invocation to a more prominent ‘Show Data Cursor’ button. Tapping on this button brings up the crosshair. Move the crosshair to any location on the figure to display the [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a while since we last <a href="http://blogs.mathworks.com/community/2011/01/31/matlab-mobile-12-released/">talked</a> about displaying data tips on MATLAB Mobile.</p>
<p>The data cursor feature has since then evolved from tap-and-hold invocation to a more prominent ‘Show Data Cursor’ button. Tapping on this button brings up the crosshair. Move the crosshair to any location on the figure to display the coordinates of that location.</p>
<p>We’re happy to announce that the latest release of MATLAB Mobile for Android supports this feature, much like its iOS counterpart.</p>
<p><a href="http://blogs.mathworks.com/community/files/datacursor1.png"><img class="alignnone size-large wp-image-2220" title="Tap on Show Data Cursor" src="http://blogs.mathworks.com/community/files/datacursor1-586x1024.png" alt="Tap on Show Data Cursor" width="282" height="491" /></a><a href="http://blogs.mathworks.com/community/files/datacursor2.png"><img class="alignnone size-large wp-image-2221" title="Position crosshair at desired location" src="http://blogs.mathworks.com/community/files/datacursor2-586x1024.png" alt="Position crosshair at desired location" width="282" height="491" /></a></p>
<p><strong><em>                     Tap on Show Data Cursor                                    Position crosshair at desired location</em></strong></p>
<p style="text-align: left;">Download MATLAB Mobile from <a href="https://play.google.com/store/apps/details?id=com.mathworks.matlabmobile">Google Play</a>.</p>
<p>If you have used the data cursor functionality on your mobile device, we would love to hear from you. Leave us a comment <a href="http://blogs.mathworks.com/community/?p=2222#respond">here </a>with your thoughts.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/05/01/data-tips-on-matlab-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Design Challenge: Autonomous Battlebots with Simulink</title>
		<link>http://blogs.mathworks.com/community/2013/04/04/design-challenge-autonomous-battlebots-with-simulink/</link>
		<comments>http://blogs.mathworks.com/community/2013/04/04/design-challenge-autonomous-battlebots-with-simulink/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 16:33:47 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2208</guid>
		<description><![CDATA[This week I welcome Dr. Paul Kassebaum to the blog. Paul is a physicist at MathWorks working to engage the public with engineering and science. He fell in love with engineering at the Cooper Union for the Advancement of Science and Art, and then became obsessed with physics at the Worcester Polytechnic Institute, where he [...]]]></description>
			<content:encoded><![CDATA[<p><em>This week I welcome Dr. Paul Kassebaum to the blog. Paul is a physicist at MathWorks working to engage the public with engineering and science. He fell in love with engineering at the Cooper Union for the Advancement of Science and Art, and then became obsessed with physics at the Worcester Polytechnic Institute, where he earned a Ph.D. specialized in quantum mechanics. His latest projects at MathWorks include designing a digital interactive museum exhibition at the Ecotarium in Worcester and managing a sponsorship between MathWorks and Artisan&#8217;s Asylum. His work at Artisan&#8217;s Asylum focuses on using MATLAB to create 3D prints that help one literally grasp abstract math and physics concepts.</em></p>
<h2>Build Your Own Autonomous Battlebot</h2>
<p>A massive maker space. Cutting-edge software. Expert mentors. And just one week to craft the most devastating robot possible.</p>
<p><em>by Dr. Paul Kassebaum</em></p>
<p>MathWorks is teaming up with <a href="http://artisansasylum.com/?page_id=215">Artisan&#8217;s Asylum</a> to wage a <a href="http://designchallengebattlebots.com/">robot battle</a> accelerated by <a href="http://www.mathworks.com/discovery/simulink-target-hardware.html">Simulink&#8217;s run on target hardware capabilities</a> and the computer controlled manufacturing tools at Artisan&#8217;s Asylum, the largest maker space on the east coast. The fight will serve as the grand finale of the Cambridge Science Festival on Sunday April 21st at the Center for Arts at the Armory, and will be free and open to the public. The contest begins on Sunday April 14th at Artisan&#8217;s Asylum, where teams will design their robots over the course of a week. To sign up and for more info, have a look at <a href="http://designchallengebattlebots.com/">designchallengebattlebots.com</a>.</p>
<p><img src="http://blogs.mathworks.com/community/files/artisansAsylumLadderView.png" alt="" title="artisansAsylumLadderView" width="600" height="338" class="alignnone size-full wp-image-2212" /></p>
<p>Sergio Biagioni is working at MathWorks to develop a Simulink framework to aid high school and undergraduate contestants in their algorithm designs. Each robot will be equipped with an <a href="http://www.mathworks.com/academia/arduino-software/arduino-simulink.html">Arduino Mega 2560</a>, a line sensor, touch sensors, sonar, and a wireless feed akin to GPS sent from an eye in the sky. The overhead camera will use the <a href="http://www.mathworks.com/products/computer-vision/">Computer Vision System Toolbox</a> to locate each robot and its orientation based on colored stickers applied to the chassis.</p>
<p><img src="http://blogs.mathworks.com/community/files/sergioWorking01.png" alt="" title="sergioWorking01" width="400" height="505" class="alignnone size-full wp-image-2211" /></p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/10b9lm4rR84" frameborder="0" allowfullscreen></iframe></p>
<p>Rob Masek, facilities manager of Artisan&#8217;s Asylum, is organizing the tournament, drawing on his experience as a (three time) contestant on Comedy Central&#8217;s BattleBots and as an organizer of several <a href="http://www.usfirst.org/roboticsprograms/frc">US FIRST Robotics competitions</a> and a home-brew robot competition called Pound of Pain. I&#8217;m confident he&#8217;ll be able to replicate his previous successes.</p>
<p><img src="http://blogs.mathworks.com/community/files/robMasek.png" alt="" title="robMasek" width="400" height="269" class="alignnone size-full wp-image-2210" /></p>
<p>Gui Cavalcanti, the founder of Artisan&#8217;s Asylum, is whipping up a robot chassis to help Sergio develop the Simulink framework all of the contestants will use. This prototype robot will be made of the same components available to the contestants, and will be offered up to the contestants to help them jump right into software development before their own chassis are fully operational. While the robots in this competition will have wheels, most of <a href="http://projecthexapod.com/blog/">Gui&#8217;s robots</a> have more than their fair share of legs.</p>
<p><img src="http://blogs.mathworks.com/community/files/guiCavalcanti.png" alt="" title="guiCavalcanti" width="400" height="497" class="alignnone size-full wp-image-2209" /></p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/qYYCMe-0kVE" frameborder="0" allowfullscreen></iframe></p>
<p>Stay tuned for more details as the story progresses!</p>
<p>And speaking of robot competitions, have you heard about <a href="http://blogs.mathworks.com/community/2013/03/25/fun-learning-and-drama-at-the-mathworks-student-robot-challenge/">MathWorks&#8217; latest robot competition in the UK</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/04/04/design-challenge-autonomous-battlebots-with-simulink/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fun, learning, and drama at the MathWorks Student Robot Challenge</title>
		<link>http://blogs.mathworks.com/community/2013/03/25/fun-learning-and-drama-at-the-mathworks-student-robot-challenge/</link>
		<comments>http://blogs.mathworks.com/community/2013/03/25/fun-learning-and-drama-at-the-mathworks-student-robot-challenge/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 15:00:32 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2181</guid>
		<description><![CDATA[This week I&#8217;d like to introduce guest blogger Dr Tanya Morton. Tanya leads the Application Engineering team in the UK, helping customers in industry and academia to apply MATLAB &#038; Simulink to their technical, business and educational challenges. She is keen to encourage more people to enjoy lifelong careers in science, technology, engineering and mathematics. [...]]]></description>
			<content:encoded><![CDATA[<p><em>This week I&#8217;d like to introduce guest blogger Dr Tanya Morton. Tanya leads the Application Engineering team in the UK, helping customers in industry and academia to apply MATLAB &#038; Simulink to their technical, business and educational challenges. She is keen to encourage more people to enjoy lifelong careers in science, technology, engineering and mathematics. You can find Tanya on <a href="http://twitter.com/tanyammorton">Twitter</a> and <a href="http://www.linkedin.com/in/tanyammorton">LinkedIn</a>.</em></p>
<h2>The MathWorks Student Robot Challenge</h2>
<p><em>by Dr. Tanya Morton, MathWorks UK</em></p>
<p>Earlier this year a colleague and I were bouncing around ideas for ways to do more outreach with the local student community. He pointed behind him and said, &#8220;Why don&#8217;t we make use of the empty space in the new office to host a robot contest?&#8221; An idea was born…</p>
<p>Last Friday, this idea came to fruition when MathWorks hosted a Student Robot Challenge. Nine teams from the University of Cambridge participated in the contest. The challenge was to develop a controller for a LEGO MINDSTORM NXT robot to make it visit a set of 12 locations on an arena in the shortest time possible. </p>
<p>After a briefing, the students started working their way through short tasks designed to bring them up to speed with Simulink, the principles of controller design, and the process of generating code to run on the robot. Within five minutes, you could hear the first robot spinning on the spot. </p>
<p><img src="http://blogs.mathworks.com/community/files/tanya1.jpg" alt=" title="tanya1" width="464" height="299" class="alignnone size-full wp-image-2187" /></p>
<p>In the afternoon, the students explored a variety of navigation and control strategies, which they tested using a combination of simulation and hardware testing on their robot. </p>
<p>The day ended with a final contest where the teams competed against each other to navigate to the most locations in the shortest time. Team names were picked out of the hat to decide the running order for the final contest.  The first to go was the QED-grad team, an experienced team of PhD engineering students. The team successfully hit all 12 locations in a time of 1 minute and 41.3 seconds. Their robot left each location quickly, but tended to spiral around the next target rather than approach it directly.</p>
<p><img src="http://blogs.mathworks.com/community/files/tanya2.jpg" alt=" title="tanya2" width="482" height="340" class="alignnone size-full wp-image-2188" /></p>
<p><em>The LEGO robot with positioning ball used in the final arena</em><br/></p>
<p>Five of the next seven teams were not able to complete the course within the 3-minute time limit. One of these teams was QED-&#8217;12, a team of first-year undergraduate engineers who had been taught to program LEGO by the QED-grad team. Briefly, it seemed that the youngest team in the competition were going to beat their lab demonstrators; however, their robot stopped at the 11th point because they had forgotten to program in the 12th. An important lesson learned! Only the team of PhD mathematicians on Team CCA came close to the time of the QED-grad team with a time of 1 minute and 44.5 seconds.  </p>
<p>The last team to go was MatLads, with its leader Richard Peach, a 3rd year undergraduate engineer. MatLads&#8217; robot moved neatly around the course to knock the QED-grad team off the top spot to win by a mere 1.6 seconds! </p>
<p><a href="http://blogs.mathworks.com/community/files/tanya3.png"><img src="http://blogs.mathworks.com/community/files/tanya3-300x300.png" alt=" title="tanya3" width="300" height="300" class="alignnone size-medium wp-image-2189" /></a></p>
<p><em>Paths taken by the fastest two robots (click to see a larger image)</em><br/></p>
<p>It was an exciting finale to a fun event. The students enjoyed the project-based learning experience and gained some valuable skills to help them in their future careers. </p>
<p><img src="http://blogs.mathworks.com/community/files/tanya4.png" alt=" title="tanya4" width="487" height="505" class="alignnone size-full wp-image-2190" /></p>
<p><em>The Final Leaderboard</em><br/></p>
<ul>
<li>If you would like to program your own LEGO robot, then a good starting point is the <a href="http://cts.businesswire.com/ct/CT?id=smartlink&#038;url=http%3A%2F%2Fwww.mathworks.co.uk%2Facademia%2Flego-mindstorms-nxt-software%2Findex.html&#038;esheet=50592064&#038;lan=en-US&#038;anchor=LEGO+MINDSTORMS+NXT+Support+from+MATLAB+and+Simulink&#038;index=3&#038;md5=bad9049bd1240188c815fbcde5322b73">LEGO MINDSTORMS NXT Support from MATLAB and Simulink</a>.</li>
<li>If you would like to encourage more project-based learning in your local university or high-school, then encourage your lecturers to learn about <a href="http://cts.businesswire.com/ct/CT?id=smartlink&#038;url=https%3A%2F%2Fwww.mathworks.co.uk%2Fcompany%2Fevents%2Fwebinars%2Fwbnr69522.html&#038;esheet=50592064&#038;lan=en-US&#038;anchor=Teaching+Mechatronics+with+MATLAB%2C+Simulink%2C+and+Low+Cost+Hardware&#038;index=4&#038;md5=d81367702921866171d96c6d706df906">Teaching Mechatronics with MATLAB, Simulink, and Low Cost Hardware</a>.</li>
<li>See the <a href="http://cts.businesswire.com/ct/CT?id=smartlink&#038;url=http%3A%2F%2Fwww.mathworks.co.uk%2Facademia%2Fcontests&#038;esheet=50592064&#038;lan=en-US&#038;anchor=Student+Robot+Challenge&#038;index=2&#038;md5=555368b33ca92ab11fb9df0d178f1035">Student Robot Challenge for further information</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/03/25/fun-learning-and-drama-at-the-mathworks-student-robot-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Challenge students with MATLAB practice on Cody</title>
		<link>http://blogs.mathworks.com/community/2013/03/18/challenge-students-with-matlab-practice-on-cody/</link>
		<comments>http://blogs.mathworks.com/community/2013/03/18/challenge-students-with-matlab-practice-on-cody/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 16:00:19 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[teaching]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2159</guid>
		<description><![CDATA[I’ve recently been talking with professors eager to use Cody in the classroom.  From these discussions, I’ve learned of seven great reasons to challenge your students with MATLAB practice problems in Cody: 1.       Great problems to draw on There are already over 900 ready-made MATLAB programming problems, in just the first year online.  Search for [...]]]></description>
			<content:encoded><![CDATA[<p><em>I’ve recently been talking with professors eager to use <a href="http://www.mathworks.com/matlabcentral/cody">Cody</a> in the classroom.  From these discussions, I’ve learned of seven great reasons to challenge your students with MATLAB practice problems in <em><a href="http://www.mathworks.com/matlabcentral/cody">Cody</a></em>:</em></p>
<p><strong style="font-size: 13px; line-height: 19px;">1.       </strong><strong style="font-size: 13px; line-height: 19px;">Great problems to draw on</strong></p>
<p>There are already over <a href="http://www.mathworks.com/matlabcentral/cody/?term=&amp;sort=created+asc">900 ready-made MATLAB programming problems</a>, in just the first year online.  Search for your subject matter of interest.  Check back often, as the Community area is growing rapidly.</p>
<p><strong style="font-size: 13px; line-height: 19px;">2.       </strong><strong style="font-size: 13px; line-height: 19px;">Fits into your workflow</strong></p>
<p>Navigate to Cody problems by hyperlink directly from your Learning Management System (LMS), HTML syllabus page or simply <a href="http://www.mathworks.com/matlabcentral/cody/problems/1-times-2-start-here">link directly into each Cody problem</a> in email to your students.</p>
<p><strong style="font-size: 13px; line-height: 19px;">3.       </strong><strong style="font-size: 13px; line-height: 19px;">Engaging for the learner</strong></p>
<p>As <a href="http://blogs.mathworks.com/videos/2012/01/27/cody-for-learning-matlab/#comment-2981">Jeff points out on the Community Blogs</a>, Cody has an addictive quality you can use to deepen student engagement.</p>
<p><strong style="font-size: 13px; line-height: 19px;">4.       </strong><strong style="font-size: 13px; line-height: 19px;">Can use online and/or with MATLAB</strong></p>
<p>Copy the Cody test suite into desktop MATLAB.  Let students write their Cody function with the full power of MATLAB, then paste their answer back into Cody to verify correctness.  For example, the <a href="http://www.mathworks.com/matlabcentral/cody/problems/1-times-2-start-here">Times 2 problem</a> could be solved in MATLAB as follows:</p>
<p>testsuite.m:<br />
<code>%%<br />
assert(isequal(times2(1),2));<br />
%%<br />
assert(isequal(times2(11),22));<br />
%%<br />
assert(isequal(times2(-3),-6));<br />
%%<br />
assert(isequal(times2(29),58));<br />
</code></p>
<p>times2.m:<br />
<code>function y = times2(x)<br />
% Modify the line below so that the output y is twice the incoming value x<br />
y = 2*x;<br />
% After you fix the code, press the "Submit" button, and you're on your way.<br />
end<br />
</code></p>
<p>Running testsuite.m confirms the function passes each test case, hence success.</p>
<p><strong style="font-size: 13px; line-height: 19px;">5.       </strong><strong style="font-size: 13px; line-height: 19px;">Create your own problems</strong></p>
<p>Try <a href="http://www.mathworks.com/matlabcentral/cody/problems/new">creating a Cody problem</a> for yourself.</p>
<p><strong style="font-size: 13px; line-height: 19px;">6.       </strong><strong style="font-size: 13px; line-height: 19px;">Experiment to see how people try to solve your problems</strong></p>
<p>Draw on the MATLAB Central community to confirm your Cody problem challenges exactly the skills you want students to learn.  We offer you a large population of MATLAB experts eager to try out the latest MATLAB programming puzzle.  Use the Solution Map to see outlier attempts, to better understand how your students could react before offering the practice problem in class.</p>
<p><a href="http://blogs.mathworks.com/community/files/6.png"><img class="alignnone size-full wp-image-2173" title="6" src="http://blogs.mathworks.com/community/files/6.png" alt="" width="669" height="476" /></a></p>
<p><strong style="font-size: 13px; line-height: 19px;">7.       </strong><strong style="font-size: 13px; line-height: 19px;">Identify learning gaps</strong></p>
<p>Using the solution map, keep an eye across multiple problems from the point in time you’ve offered in class.  Compare these across problems to identify subject matter areas meriting more lecture coverage.  For example,</p>
<p><a href="http://www.mathworks.com/matlabcentral/cody/problems/7-column-removal">Problem 7: Column Removal</a><br />
<a href="http://blogs.mathworks.com/community/files/71.png"><img class="alignnone size-full wp-image-2172" title="7" src="http://blogs.mathworks.com/community/files/71.png" alt="" width="660" height="179" /></a><br />
shows a cluster of incorrect attempts worth exploring.  You’ll quickly see which topics need follow-up coverage in class.</p>
<p><em>I’ve also prepared a five minute <a href="http://www.mathworks.com/videos/challenge-students-with-matlab-practice-on-cody-77142.html">video</a> to demonstrate the above points.  Please let me know how you’ve found Cody helpful.</em></p>
<p><em>Try Cody for yourself at <a href="http://www.mathworks.com/matlabcentral/cody">www.mathworks.com/matlabcentral/cody</a>, and get your students addicted to learning in MATLAB.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/03/18/challenge-students-with-matlab-practice-on-cody/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dancing in the spotlight – The intersection between robotics, video processing and art</title>
		<link>http://blogs.mathworks.com/community/2013/03/04/dancing-in-the-spotlight-%e2%80%93-the-intersection-between-robotics-video-processing-and-art/</link>
		<comments>http://blogs.mathworks.com/community/2013/03/04/dancing-in-the-spotlight-%e2%80%93-the-intersection-between-robotics-video-processing-and-art/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 14:00:52 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2137</guid>
		<description><![CDATA[This week I&#8217;d like to introduce guest blogger Joachim Schlosser. Joachim leads the team of Education Technical Specialists in Europe, supporting professors and teaching staff using MATLAB &#38; Simulink in education. His mission is to serve development organizations, universities, professors and engineers in all stages of their career to best leverage their proficiency by finding [...]]]></description>
			<content:encoded><![CDATA[<p><em>This week I&#8217;d like to introduce guest blogger Joachim Schlosser. Joachim leads the team of Education Technical Specialists in Europe, supporting professors and teaching staff using MATLAB &amp; Simulink in education. His mission is to serve development organizations, universities, professors and engineers in all stages of their career to best leverage their proficiency by finding out what kind of methodology and tools are of greatest use for them. You can find Joachim on <a href="http://twitter.com/schlosi">Twitter</a>, <a href="http://www.linkedin.com/in/jschlosser">LinkedIn</a> and <a href="http://plus.google.com/108573450649244839154?rel=author">Google+</a>.</em></p>
<h2>Dancing in the Spotlight</h2>
<p><em>by Joachim Schlosser</em></p>
<p>I love trade shows and conferences, because you get the opportunity to speak with people creating very different things all on one day. The Embedded World trade show, held each year end of February in Nuremberg, Germany, is such an event. Every time it is amazing to see the breadth of topics that people approach us on, and it is fun to discuss and find out which of our tools around MATLAB &amp; Simulink can make them successful.</p>
<h2>Dancing: Enter Anna.</h2>
<p>People might stop because they see our hostess Anna making the cute little Nao robot dance, but they come into discussion because they get the vision about what <em>they</em> could achieve themselves. What they see on the booth is just a catalyst for people&#8217;s own insight and needs, just a starting point to evaluate which tools serve best their applications.</p>
<p><img src="http://blogs.mathworks.com/community/files/anna.jpg" alt="" title="anna" width="500" height="322" class="alignnone size-full wp-image-2141" /><br />
<br/><span style="font-size:8px;"><em>Photo courtesy Joachim Schlosser.</em></span></p>
<h2>Movement: Enter John.</h2>
<p>Enter booth visitor John (not his real name) from Ynapmoc, Inc. (not his real company), a small to mid size manufacturer with 40 years of experience in the area of medical devices (not his real industry). When he approached me, he said he stopped because he noticed we somehow analyze the real picture data, and he was curious to find out more. He then found yet another demonstration in the booth where a Simulink model made an Arduino board with a webcam track and follow a colored ball. Think of it as a stripped down version of <a href="http://www.youtube.com/watch?v=paytCdcLRno">this one</a>, but you get the idea. </p>
<p>Now the reason John was curious is because they are abstracting movements of people filmed in their lab to detect anomalies in their muscle tissue functions and provide a self-assessment tool (not his real application). They had been coding it by hand, with little possibility to do fast prototyping, and with additional effort to adapt the functionality each time they got another camera, each time they have another idea to make the algorithm better. To see that he could do <a href="http://www.mathworks.com/image-video-processing/">video processing in Simulink</a> was a relief to him, since he knew it from his engineering studies. To see additionally that he could <a href="http://www.mathworks.com/academia/arduino-software/">real-time prototype on a low cost Arduino board</a> made John enthusiastic.</p>
<h2>Grid stability: Enter Lynn.</h2>
<p>Enter Lynn (not her real name), engineer from Sunshine Corp (not her real company), who works on electrical energy generators used in production plants as backup to the regular power grid (not her real application). She had seen our offerings around <a href="http://www.mathworks.com/products/simpower/">simulating electrical systems</a> and wondered whether this would not just work for simulating an isolated device but the production plant&#8217;s power grid as a whole. </p>
<p>Well, it&#8217;s not just possible to simulate an entire plant&#8217;s grid, Transpower from New Zealand went a bit further and <a href="http://www.mathworks.com/company/user_stories/Transpower-Ensures-Reliability-of-New-Zealand-National-Grid-with-Reserve-Management-Tool.html">simulated the entire national grid</a>. They do this to calculate the reserve they need to provide in order to maintain grid stability. So, Lynn has made her next step in solving her challenge, discussing the scenario with one of our Application Engineers to find out the exact needs and a plan for implementing the solution.</p>
<p>Now what if you combine both, image processing and control?</p>
<h2>3D Imaging: Enter Nao.</h2>
<p>Enter <a href="http://www.aldebaran-robotics.com/en">Nao</a> (its real name) from Aldebaran (its real company). Nao is the little robot from the beginning of this story. Think of movement. Think of control theory. Think of feedback control. Think of Simulink. And now attach <a href="http://www.mathworks.com/academia/kinect/">Microsoft® Kinect® with its support in MATLAB &amp; Simulink</a>, one of the many <a href="http://www.mathworks.com/academia/hardware-resources/">hardware resources for project-based learning</a>. Kinect provides a 3D image of a person, which is transformed into a mesh in MATLAB &amp; Simulink, allowing it to calculate trajectories for the robot. The rest is <em>normal</em> control system theory with Model-Based Design. </p>
<p><img src="http://blogs.mathworks.com/community/files/kinect.jpg" alt="" title="kinect" width="500" height="420" class="alignnone size-full wp-image-2142" /></p>
<p>You get: A dancing machine being able to mimic movements of a human. A lot of fun in the realms of engineering, science, commercial and education developments, controls, video, data analysis. And lots of nice discussions with bright people of different disciplines who either are already using MATLAB &amp; Simulink or are exploring their way into doing so. To live and breathe their art.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/03/04/dancing-in-the-spotlight-%e2%80%93-the-intersection-between-robotics-video-processing-and-art/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Your MATLAB Files on the Cloud. And more.</title>
		<link>http://blogs.mathworks.com/community/2013/02/25/your-matlab-files-on-the-cloud-and-more/</link>
		<comments>http://blogs.mathworks.com/community/2013/02/25/your-matlab-files-on-the-cloud-and-more/#comments</comments>
		<pubDate>Mon, 25 Feb 2013 17:40:50 +0000</pubDate>
		<dc:creator>Pradeep Ramamoorthy</dc:creator>
				<category><![CDATA[MATLAB Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2051</guid>
		<description><![CDATA[Happy 2013! 2012 was an eventful year for MATLAB Mobile, with releases for the iPad, the Android platform, and several enhancements to graphics and usability. To kick off 2013 on a high note, we are making connecting to the cloud even better. Introducing… MATLAB Cloud Storage You can now upload MATLAB files and data to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Happy 2013!</p>
<p style="text-align: justify;">2012 was an eventful year for MATLAB Mobile, with releases for the <a href="http://blogs.mathworks.com/community/2012/01/16/matlab-mobile-ipad-app/">iPad</a>, the <a href="http://blogs.mathworks.com/community/2012/10/18/matlab-mobile-for-android/">Android</a> platform, and several enhancements to graphics and usability.</p>
<p style="text-align: justify;">To kick off 2013 on a high note, we are making connecting to the cloud even better.</p>
<p style="text-align: justify;"><strong>Introducing… MATLAB Cloud Storage</strong></p>
<p style="text-align: justify;">You can now upload MATLAB files and data to MathWorks Cloud and run them from MATLAB Mobile. You can also download your files from the cloud and save them to your computer.</p>
<p style="text-align: left;">To upload your files, navigate to the MATLAB Cloud Storage page at <a href="https://www.mathworks.com/mobile/cloud-storage.html">https://www.mathworks.com/mobile/cloud-storage.html</a>. To access this page, you will need to have a valid MathWorks Account associated with a license that is current on maintenance. You will also need to have created a user ID on MATLAB Mobile.</p>
<div>
<p style="text-align: left;">Once your files have been uploaded, you can execute them from your mobile device running MATLAB Mobile. For more information, please refer to <a href="http://www.mathworks.com/mobile/store-files-on-cloud.html">Store MATLAB files on the cloud</a>.<a style="text-align: center;" href="http://blogs.mathworks.com/community/files/cloudstorage1.png"><img class="size-full wp-image-2084" title="Cloud Storage for MATLAB Mobile" src="http://blogs.mathworks.com/community/files/cloudstorage1.png" alt="" width="539" height="282" /></a></p>
<p>&nbsp;</p>
<p style="text-align: justify;"><strong>But wait, there&#8217;s more!</strong></p>
<p style="text-align: justify;">- When you connect to MathWorks cloud, you can now access all your licensed MathWorks products.</p>
<p style="text-align: justify;">- We’ve also added a customized keyboard for the Android platform, making it easy for you to enter MATLAB commands without having to switch between multiple screens. The keyboard provides easy access to commonly used MATLAB characters like parenthesis, indexing operators, arithmetic operators and the like. You can also access previously entered commands with the touch of a single key. Tapping and holding on selected keys displays additional characters. For instance, a long tap on the ‘.’ key displays the list of characters in blue.</p>
<p><a href="http://blogs.mathworks.com/community/files/keyboard2_framed.png"><img class="alignnone size-large wp-image-2055" title="Custom Keyboard for Android" src="http://blogs.mathworks.com/community/files/keyboard2_framed-613x1024.png" alt="" width="258" height="430" /></a><a href="http://blogs.mathworks.com/community/files/keyboard1_framed.png"><img class="alignnone size-large wp-image-2054" title="Tap and Hold for Additional Characters" src="http://blogs.mathworks.com/community/files/keyboard1_framed-613x1024.png" alt="" width="258" height="430" /></a></p>
<p style="text-align: justify;">- MATLAB Mobile for iOS now supports iPhone 5 and iPad mini.</p>
<p style="text-align: justify;">To download the latest version of MATLAB Mobile, visit the <a href="https://itunes.apple.com/us/app/matlab-mobile/id370976661?mt=8">App Store</a> or <a href="https://play.google.com/store/apps/details?id=com.mathworks.matlabmobile">Google Play</a>.</p>
<p style="text-align: justify;">With cloud storage, what files are you running from your mobile device? How is the new Android keyboard helping you? Leave us a comment <a href="http://blogs.mathworks.com/community/?p=2051#respond">here </a>with your thoughts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/02/25/your-matlab-files-on-the-cloud-and-more/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Visualizing Cody</title>
		<link>http://blogs.mathworks.com/community/2013/02/11/visualizing-cody/</link>
		<comments>http://blogs.mathworks.com/community/2013/02/11/visualizing-cody/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 23:45:50 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2047</guid>
		<description><![CDATA[Because of the amount of traffic that it gets, Cody generates a tremendous amount of interesting data every day. Most of it gets silently stored, because we haven&#8217;t found good ways to reflect it directly in the application yet. I decided it was time to try out some Javascript visualization techniques on the data. This [...]]]></description>
			<content:encoded><![CDATA[<p>Because of the amount of traffic that it gets, <a href="http://www.mathworks.com/matlabcentral/cody/">Cody</a> generates a tremendous amount of interesting data every day. Most of it gets silently stored, because we haven&#8217;t found good ways to reflect it directly in the application yet. I decided it was time to try out some Javascript visualization techniques on the data. This is the result: <a href="http://blogs.mathworks.com/images/desktop/viz/cody_viz.html">Cody Data Visualizer</a>.</p>
<p><img src="http://blogs.mathworks.com/community/files/cody-vis.png" alt="" title="cody-vis" width="373" height="364" class="alignnone size-full wp-image-2088" /></p>
<p>Go play around with it and tell me what you find. Shown above is one view: author ID vs. problem ID. It shows patterns of how problem authors contribute. The size of the dots is relative to the number of comments on the problem. That horizontal stripe across this middle at around author_id = 3000 is super contributor (and current Cody front runner) <a href="http://www.mathworks.com/matlabcentral/cody/players/2789428-richard-zapor">Richard Zapor</a>, who has single-handedly contributed 122 problems!</p>
<p>This tool loads a relatively large (200 KB) data set when it starts up, so please be patient as it loads! Also, please note that this is an experimental tool that works with an archived static data set from February 8, 2013. It won&#8217;t reflect changes in Cody after that date.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/02/11/visualizing-cody/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Giving by Taking: File Exchange Acknowledgment Trees</title>
		<link>http://blogs.mathworks.com/community/2013/01/15/giving-by-taking-file-exchange-acknowledgment-trees/</link>
		<comments>http://blogs.mathworks.com/community/2013/01/15/giving-by-taking-file-exchange-acknowledgment-trees/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 20:20:27 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=2015</guid>
		<description><![CDATA[One of the virtues of a good programmer (as observed by Larry Wall) is laziness. Don&#8217;t write code that you don&#8217;t have to! In this spirit, the File Exchange is a boon to the lazy. Whenever you sit down to code, listen to the voice that says &#8220;someone must have written this already.&#8221; Because it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>One of the virtues of a good programmer (as <a href="http://c2.com/cgi/wiki?LazinessImpatienceHubris">observed by Larry Wall</a>) is <em>laziness</em>. Don&#8217;t write code that you don&#8217;t have to! In this spirit, the File Exchange is a boon to the lazy. Whenever you sit down to code, listen to the voice that says &#8220;someone <em>must</em> have written this already.&#8221; Because it&#8217;s probably good advice. Sometimes you&#8217;ll find exactly what you need on the File Exchange. Done! Other times you might find something that&#8217;s <em>close</em> to the right thing, but not quite. In those cases, consider taking what you find and adapting it to your needs&#8230; and then consider resubmitting your adapted code to the File Exchange.</p>
<p>It may feel like cheating at first, but the File Exchange has a mechanism to let you acknowledge the person (or people) that you borrowed code from.</p>
<p>When you submit a file to the File Exchange, you come across a section called &#8220;License and Acknowledgments.&#8221; This gives you a place to mention the other files that helped you create yours, either because you borrowed code from them or because you just want to publicly acknowledge your appreciation of their influence.</p>
<p><img class="alignnone size-full wp-image-2017" title="fx-ack" src="http://blogs.mathworks.com/community/files/fx-ack.png" alt="" width="537" height="156" /></p>
<p>Here&#8217;s an example. When <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/22680">Douglas Schwarz</a> wrote his highly regarded <a href="http://www.mathworks.com/matlabcentral/fileexchange/11837">Fast and Robust Curve Intersections</a>, he made sure to acknowledge the pre-existing file <a href="http://www.mathworks.com/matlabcentral/fileexchange/8908">Curve Intersect 2</a> by <a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/15000">Sebastian Hölz</a>. We&#8217;ve had this feature in place for many years, and I decided it was time to take a look at the patterns of attribution that we see.</p>
<p>Of the more than 17,000 files on the File Exchange, there are 2910 separate acknowledgments like the one mentioned above. In one way or another, 2050 files acknowledge their debt to a total of 1870 inspiring files. If you think of each one of these acknowledgments as a pointer from the inspiring file to the inspired file, then the whole site can be thought of as a <a href="http://en.wikipedia.org/wiki/Directed_graph">directed graph</a>. Consider the example above. The inspiration doesn&#8217;t stop with Douglas Schwarz&#8217;s file. That one went on to inspire others. Here&#8217;s a look at the acknowledgment tree.</p>
<p><img class="alignnone size-full wp-image-2029" title="acktree_8908" src="http://blogs.mathworks.com/community/files/acktree_8908.png" alt="" width="511" height="290" /></p>
<p>In this picture, each box is a different submission labeled with the author&#8217;s last name. Isn&#8217;t that lovely? It&#8217;s exciting to see the &#8220;footprints&#8221; of good ideas as they move through the site.</p>
<p>These patterns of acknowledgment can be extensive and visually striking. Some of the trees are deep and some are wide. Here&#8217;s a wide one that starts with Oliver Woodford&#8217;s <a href="http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig">exportfig</a>.</p>
<p><img class="alignnone size-full wp-image-2031" title="acktree_23629" src="http://blogs.mathworks.com/community/files/acktree_23629.png" alt="" width="600" height="78" /></p>
<p>With our link data, we can figure out which is the single most influential file in terms of link count. And the answer is&#8230; <a href="http://www.mathworks.com/matlabcentral/fileexchange/69">one of the oldest files on the site</a> from Christophe Couvreur. Take a look at how wide this one is.</p>
<p><img class="alignnone size-full wp-image-2033" title="acktree_69" src="http://blogs.mathworks.com/community/files/acktree_69.png" alt="" width="600" height="53" /></p>
<p>The largest fully-connected subnet of files has over 200 files in it, all of them connected to each other through a series of links, each link a thoughtful token of respect.</p>
<p>If we go from a file-centric to an author-centric view, we can determine the most influential authors. Who has the most acknowledgments considering all the files they submitted (we ignore self-linking for this analysis). In other words, which authors are the most influential?</p>
<ol>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/679">John D&#8217;Errico</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/1034">Christophe COUVREUR</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/27420">Yair Altman</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/10584">Jos</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/3777">Scott Hirsch</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/22524">Yi Cao</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/23816">Malcolm Lidierth</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/120528">Robert Bemis</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/22680">Douglas Schwarz</a></li>
<li><a href="http://www.mathworks.com/matlabcentral/fileexchange/authors/29180">Dirk-Jan Kroon</a></li>
</ol>
<p>These people are heroes of the MATLAB Community. They have freely given, and we have all benefited.</p>
<p>I want to see your name on this list!</p>
<p>Let&#8217;s say you agree. Let&#8217;s say you&#8217;re ready to let people start building on your code. How do you start? Paradoxically, a good way to start is by borrowing someone else&#8217;s code. You&#8217;ll learn good coding practices by borrowing from the best, and you&#8217;re likelier to build something worth borrowing by standing on the shoulders of others. You&#8217;ll also be bound more deeply into the community. And soon you&#8217;ll see how satisfying it is to have someone use your code as a springboard for something wonderful that never would have occurred to you. So give by taking. You&#8217;ll be surprised how far it gets you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/01/15/giving-by-taking-file-exchange-acknowledgment-trees/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Football Squares with MATLAB</title>
		<link>http://blogs.mathworks.com/community/2013/01/07/football-squares-with-matlab/</link>
		<comments>http://blogs.mathworks.com/community/2013/01/07/football-squares-with-matlab/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 19:58:51 +0000</pubDate>
		<dc:creator>Ned Gulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=1996</guid>
		<description><![CDATA[h1 { font-size:18pt; } h2.titlebg { font-size:13pt; } h3 { color:#4A4F55; padding:0px; margin:5px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:11pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; } h4 { color:#4A4F55; padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; } p { padding:0px; margin:0px 0px 20px; } img { padding:0px; margin:0px [...]]]></description>
			<content:encoded><![CDATA[<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style type="text/css">

h1 { font-size:18pt; }
h2.titlebg { font-size:13pt; }
h3 { color:#4A4F55; padding:0px; margin:5px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:11pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }
h4 { color:#4A4F55; padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }
   
p { padding:0px; margin:0px 0px 20px; }
img { padding:0px; margin:0px 0px 20px; border:none; }
p img, pre img, tt img, li img { margin-bottom:0px; } 

ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }
ul li { padding:0px; margin:0px 0px 7px 0px; background:none; }
ul li ul { padding:5px 0px 0px; margin:0px 0px 7px 23px; }
ul li ol li { list-style:decimal; }
ol { padding:0px; margin:0px 0px 20px 0px; list-style:decimal; }
ol li { padding:0px; margin:0px 0px 7px 23px; list-style-type:decimal; }
ol li ol { padding:5px 0px 0px; margin:0px 0px 7px 0px; }
ol li ol li { list-style-type:lower-alpha; }
ol li ul { padding-top:7px; }
ol li ul li { list-style:square; }

pre, tt, code { font-size:12px; }
pre { margin:0px 0px 20px; }
pre.error { color:red; }
pre.codeinput { padding:10px; border:1px solid #d3d3d3; background:#f7f7f7; }
pre.codeoutput { padding:10px 11px; margin:0px 0px 20px; color:#4c4c4c; }

@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } }

span.keyword { color:#0000FF }
span.comment { color:#228B22 }
span.string { color:#A020F0 }
span.untermstring { color:#B20000 }
span.syscmd { color:#B28C00 }

.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
.footer p { margin:0px; }

  </style><div class="content"><h3>Contents</h3><div><ul><li><a href="#8c9e5dad-68bb-46b1-a0e7-65bdefbfa3d4">Super Bowl Squares</a></li><li><a href="#f037784c-a846-4abb-869c-dac0badec9f0">Get the Data</a></li><li><a href="#37cc7e96-10c0-44ad-92fa-ac940e86d943">Regular Expressions to the Rescue!</a></li><li><a href="#393b42da-4eb2-4ab8-bcbb-d9fd5ba13c03">Populate the Results Matrix</a></li><li><a href="#c303e8ed-3c40-46e9-9182-895412e5461f">Compute the Probability Matrix</a></li><li><a href="#e6bcb479-ed02-470e-8a77-1734081a9d44">Add Numbers to the Plot</a></li><li><a href="#f5119a8d-cfb6-4e1c-b8f1-23679bbccb6b">The Bottom Line</a></li></ul></div><h4>Super Bowl Squares<a name="8c9e5dad-68bb-46b1-a0e7-65bdefbfa3d4"></a></h4><p><a href="http://blogs.mathworks.com/community/2012/11/20/england-football-and-comma-separated-tables/">In my last post</a> I wrote about English football. This time I'm talking about the American version. Here in the U.S. it's playoff season for professional football, and that means greasy food, beer, big-screen televisions, and football squares.</p><p>And what are football squares, you may ask? It's a simple mechanism to let a group of people wager on the outcome of a ballgame. Consider the following plot.</p><pre class="codeinput">a = invhilb(10)&lt;0;
<span class="comment">% Why invhilb? See this Cody problem:</span>
<span class="comment">%   http://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix</span>
tick = 0:9;
imagesc(tick,tick,a)
colormap([1; 0.8]*[1 1 1])
set(gca, <span class="keyword">...</span>
    <span class="string">'XAxisLocation'</span>,<span class="string">'top'</span>, <span class="keyword">...</span>
    <span class="string">'XTick'</span>,tick, <span class="keyword">...</span>
    <span class="string">'YTick'</span>,tick)
axis <span class="string">square</span>
xlabel(<span class="string">'Last Digit of Team A''s Score'</span>)
ylabel(<span class="string">'Last Digit of Team B''s Score'</span>)
</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/community/files/squares_01.png" alt=""> <p>It has 100 small squares in it, each one corresponding to a pair of one-digit numbers. These one-digit numbers, in turn, correspond to the last digit in the final score of one of the two teams. Before the game, everyone buys one or more squares until they've all been sold. Now, if the Alligators (team A) go on to defeat the Buckaroos (team B) 17-10, then the owner of the square at location (7,0) would be the winner.</p><p>As you can imagine, some score pairs are much more likely than others. For this reason, in practice the squares are usually sold off at random. You don't get to pick which score pair you will receive.</p><p>All this sets the scene for a Super Bowl party from a few years ago. The Green Bay Packers were playing the Pittsburgh Steelers, and I had acquired a square. But not just any square. My square was linked to the score pair (2,2).</p><p><img vspace="5" hspace="5" src="http://blogs.mathworks.com/community/files/football-squares.png" alt=""> </p><p>This struck me as a rare score pair. But how rare? Being quantitatively minded, and armed with my favorite technical computing tool, I went looking for data.</p><p>A little web searching turned up a site with <a href="http://www.pro-football-reference.com/boxscores/game_scores.cgi#game_scores::none">every single NFL football game played since 1920</a>, nearly 15,000 games. A savvy reader may observe that the game has changed a lot during that interval. Nevermind that! Let's do the calculations and see what we get.</p><h4>Get the Data<a name="f037784c-a846-4abb-869c-dac0badec9f0"></a></h4><p>First grab the HTML.</p><pre class="codeinput">url = <span class="string">'http://www.pro-football-reference.com/boxscores/game_scores.cgi#game_scores::none'</span>;
html = urlread(url);
</pre><h4>Regular Expressions to the Rescue!<a name="37cc7e96-10c0-44ad-92fa-ac940e86d943"></a></h4><p>By carefully examining the structure of the HTML, we can make a regular expression target that will extract the information we need.</p><pre class="codeinput">target = [ <span class="keyword">...</span>
    <span class="string">'&lt;tr  class=""&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right"  csk.*?&gt;.*?&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right"  csk.*?&gt;.*?&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right" &gt;(\d+)&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right" &gt;(\d+)&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right" &gt;\d+&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right" &gt;\d+&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    <span class="string">'&lt;td align="right"  csk.*?&gt;&lt;a href=".*?"&gt;(\d+)&lt;/a&gt;&lt;/td&gt;\s*'</span> <span class="keyword">...</span>
    ];
tk = regexp(html,target,<span class="string">'tokens'</span>);
</pre><h4>Populate the Results Matrix<a name="393b42da-4eb2-4ab8-bcbb-d9fd5ba13c03"></a></h4><p>Armed with the textual data from the HTML, we can insert it into a matrix with counts for all the possible outcomes.</p><pre class="codeinput">score = zeros(100);
oneDigitScore = zeros(10);

<span class="keyword">for</span> i = 1:length(tk)
    winning = str2num(tk{i}{1});
    winningMod10 = mod(winning,10);
    losing = str2num(tk{i}{2});
    losingMod10 = mod(losing,10);
    game_count = str2num(tk{i}{3});

    <span class="comment">% 100-by-100 score grid with actual final scores</span>
    score(winning+1,losing+1) = game_count;

    <span class="comment">% 10-by-10 score grid with mod 10 final scores</span>
    oneDigitScore(winningMod10+1,losingMod10+1) = oneDigitScore(winningMod10+1,losingMod10+1) + game_count/2;
    oneDigitScore(losingMod10+1,winningMod10+1) = oneDigitScore(losingMod10+1,winningMod10+1) + game_count/2;

<span class="keyword">end</span>
</pre><h4>Compute the Probability Matrix<a name="c303e8ed-3c40-46e9-9182-895412e5461f"></a></h4><p>Calculate percentages based on the total number of games and visualize the results.</p><pre class="codeinput">prob = oneDigitScore/sum(oneDigitScore(:))*100;
imagesc(0:9,0:9,prob)
colormap(summer(64))
colorbar

set(gca, <span class="keyword">...</span>
    <span class="string">'XAxisLocation'</span>,<span class="string">'top'</span>, <span class="keyword">...</span>
    <span class="string">'XTick'</span>,tick, <span class="keyword">...</span>
    <span class="string">'YTick'</span>,tick)
axis <span class="string">square</span>
xlabel(<span class="string">'Last Digit of Team A''s Score'</span>)
ylabel(<span class="string">'Last Digit of Team B''s Score'</span>)
</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/community/files/squares_02.png" alt=""> <p>Just to be safe, let's verify that the sum of the probability matrix is 100%.</p><pre class="codeinput">fprintf(<span class="string">'Sum of all probabilities (percent): %2.1f\n'</span>,sum(prob(:)));
</pre><pre class="codeoutput">Sum of all probabilities (percent): 100.0
</pre><h4>Add Numbers to the Plot<a name="e6bcb479-ed02-470e-8a77-1734081a9d44"></a></h4><p>No surprise: the likeliest outcome is the pair (7,0) or (0,7). What about (2,2)? It's looking pretty grim. Let's throw some numbers on the plot to find out.</p><pre class="codeinput">colorbar <span class="string">off</span>

[rows,cols] = size(prob);
<span class="keyword">for</span> i = 1:rows
  <span class="keyword">for</span> j = 1:cols
    text(j-1,i-1,sprintf(<span class="string">'%1.2f'</span>,prob(i,j)),<span class="keyword">...</span>
        <span class="string">'FontSize'</span>, 8, <span class="keyword">...</span>
      <span class="string">'Color'</span>,<span class="string">'red'</span>, <span class="keyword">...</span>
      <span class="string">'HorizontalAlignment'</span>,<span class="string">'center'</span>);
  <span class="keyword">end</span>
<span class="keyword">end</span>

set(gca,<span class="string">'XAxisLocation'</span>,<span class="string">'top'</span>)
xlabel(<span class="string">'Last Digit of Steelers Score'</span>)
ylabel(<span class="string">'Last Digit of Packers Score'</span>)

patch([2 3 3 2 2]-0.5,[2 2 3 3 2]-0.5,<span class="string">'red'</span>, <span class="keyword">...</span>
  <span class="string">'FaceColor'</span>,<span class="string">'none'</span>,<span class="string">'LineWidth'</span>,2,<span class="string">'EdgeColor'</span>,<span class="string">'yellow'</span>)
patch([5 6 6 5 5]-0.5,[1 1 2 2 1]-0.5,<span class="string">'red'</span>, <span class="keyword">...</span>
  <span class="string">'FaceColor'</span>,<span class="string">'none'</span>,<span class="string">'LineWidth'</span>,2,<span class="string">'EdgeColor'</span>,<span class="string">'yellow'</span>)
</pre><img vspace="5" hspace="5" src="http://blogs.mathworks.com/community/files/squares_03.png" alt=""> <p>Ouch!</p><h4>The Bottom Line<a name="f5119a8d-cfb6-4e1c-b8f1-23679bbccb6b"></a></h4><p>All this is a long-winded way of saying that my pick, (2,2), is the absolute worst possible choice. Since the merger in 1970, there have been <i>exactly two games</i> that ended with (2,2). On December 5, 2004, the Buffalo Bills beat the Miami Dolphins 42-32, and on November 4, 2012 the Tampa Bay Buccaneers defeated the Oakland Raiders by the same score.</p><p>Incidentally, the actual winning result for Steelers-Packers Super Bowl, (1,5), is also quite rare. Rare as these things go, but still eleven times more likely than (2,2).</p><p>Not that I'm bitter about it.</p>

<h4>Addendum</h4>
<p>
LATE ADDITION: In the comments below, Sean and Matt banter about soccer scores and the Football Squares game. Here is the plot that results from English Premier League games (partial season). Numbers shown are percentages.
</p>

<p><img hspace="5" vspace="5" src="http://blogs.mathworks.com/community/files/soccer-squares.png" alt="" title="soccer-squares" width="393" height="391" class="alignnone size-full wp-image-2074" /></p>

<script language="JavaScript"> <!-- 
    function grabCode_c52d932239354ddabeadec30b05742fe() {
        // 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='c52d932239354ddabeadec30b05742fe ' + '##### ' + 'SOURCE BEGIN' + ' #####';
        t2='##### ' + 'SOURCE END' + ' #####' + ' c52d932239354ddabeadec30b05742fe';
    
        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;');

        copyright = 'Copyright 2013 The MathWorks, Inc.';

        w = window.open();
        d = w.document;
        d.write('<pre>\n');
        d.write(code_string);

        // Add copyright line at the bottom if specified.
        if (copyright.length > 0) {
            d.writeln('');
            d.writeln('%%');
            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_c52d932239354ddabeadec30b05742fe()"><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; R2012b<br /></p><p class="footer"><br />
      Published with MATLAB&reg; R2012b<br /></p></div><!--
c52d932239354ddabeadec30b05742fe ##### SOURCE BEGIN #####
%% Super Bowl Squares
% <http://blogs.mathworks.com/community/2012/11/20/england-football-and-comma-separated-tables/
% In my last post> I wrote about English football. This time I'm talking
% about the American version. Here in the U.S. it's playoff season for
% professional football, and that means greasy food, beer, big-screen
% televisions, and football squares.
%
% And what are football squares, you may ask? It's a simple mechanism to
% let a crowd of people wager on the outcome of a ballgame. Consider the
% following plot.

a = invhilb(10)<0; 
% Why invhilb? See this Cody problem:
%   http://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix
tick = 0:9;
imagesc(tick,tick,a)
colormap([1; 0.8]*[1 1 1])
set(gca, ...
    'XAxisLocation','top', ...
    'XTick',tick, ...
    'YTick',tick)
axis square
xlabel('Last Digit of Team A''s Score')
ylabel('Last Digit of Team B''s Score')

%%
% It has 100 small squares in it, each one corresponding to a pair of
% one-digit numbers. These one-digit numbers, in turn, correspond to the
% last digit in the final score of one of the two teams. Before the game,
% everyone buys one or more squares until they've all been sold. Now, if
% the Alligators (team A) go on to defeat the Buckaroos (team B) 17-10,
% then the owner of the square at location (7,0) would be the winner. 
%
% As you can imagine, some score pairs are much more likely than others.
% For this reason, in practice the squares are usually sold off at random.
% You don't get to pick which score pair you will receive. 
%
% All this sets the scene for a Super Bowl party from a few years ago. The
% Green Bay Packers were playing the Pittsburgh Steelers, and I had acquired
% a square. But not just any square. My square was linked to the score
% pair (2,2).
%
% <<http://inside-files.mathworks.com/public/Ned_Gulley/images/football-squares.png>>
%
% This struck me as a rare score pair. But how rare? Being quantitatively
% minded, and armed with my favorite technical computing tool, I went
% looking for data.
%
% A little web searching turned up a site with
% <http://www.pro-football-reference.com/boxscores/game_scores.cgi#game_scores::none
% every single NFL football game played since 1920>, nearly 15,000 games. A savvy
% reader may observe that the game has changed a lot during that interval.
% Nevermind that! Let's do the calculations and see what we get.

%% Get the Data
% First grab the HTML.

url = 'http://www.pro-football-reference.com/boxscores/game_scores.cgi#game_scores::none';
html = urlread(url);

%% Regular Expressions to the Rescue!
% By carefully examining the structure of the HTML, we can make a regular
% expression target that will extract the information we need.

target = [ ...
    '<tr  class="">\s*' ...
    '<td align="right"  csk.*?>.*?</td>\s*' ...
    '<td align="right"  csk.*?>.*?</td>\s*' ...
    '<td align="right" >(\d+)</td>\s*' ...
    '<td align="right" >(\d+)</td>\s*' ...
    '<td align="right" >\d+</td>\s*' ...
    '<td align="right" >\d+</td>\s*' ...
    '<td align="right"  csk.*?><a href=".*?">(\d+)</a></td>\s*' ...
    ];
tk = regexp(html,target,'tokens');

%% Populate the Results Matrix
% Armed with the textual data from the HTML, we can insert it into a matrix
% with counts for all the possible outcomes.

score = zeros(100);
oneDigitScore = zeros(10);

for i = 1:length(tk)
    winning = str2num(tk{i}{1});
    winningMod10 = mod(winning,10);
    losing = str2num(tk{i}{2});
    losingMod10 = mod(losing,10);
    game_count = str2num(tk{i}{3});
    
    % 100-by-100 score grid with actual final scores
    score(winning+1,losing+1) = game_count;
    
    % 10-by-10 score grid with mod 10 final scores
    oneDigitScore(winningMod10+1,losingMod10+1) = oneDigitScore(winningMod10+1,losingMod10+1) + game_count/2;
    oneDigitScore(losingMod10+1,winningMod10+1) = oneDigitScore(losingMod10+1,winningMod10+1) + game_count/2;
    
end

%% Compute the Probability Matrix
% Calculate percentages based on the total number of games and visualize
% the results.

prob = oneDigitScore/sum(oneDigitScore(:))*100;
imagesc(0:9,0:9,prob)
colormap(summer(64))
colorbar

set(gca, ...
    'XAxisLocation','top', ...
    'XTick',tick, ...
    'YTick',tick)
axis square
xlabel('Last Digit of Team A''s Score')
ylabel('Last Digit of Team B''s Score')


%% 
% Just to be safe, let's verify that the sum of the probability matrix is
% 100%.

fprintf('Sum of all probabilities (percent): %2.1f\n',sum(prob(:)));

%% Add Numbers to the Plot
% No surprise: the likeliest outcome is the pair (7,0) or (0,7). What about
% (2,2)? It's looking pretty grim. Let's throw some numbers on the plot to
% find out.

colorbar off

[rows,cols] = size(prob);
for i = 1:rows
  for j = 1:cols
    text(j-1,i-1,sprintf('%1.2f',prob(i,j)),...
        'FontSize', 8, ...
      'Color','red', ...
      'HorizontalAlignment','center');
  end
end

set(gca,'XAxisLocation','top')
xlabel('Last Digit of Steelers Score')
ylabel('Last Digit of Packers Score')

patch([2 3 3 2 2]-0.5,[2 2 3 3 2]-0.5,'red', ...
  'FaceColor','none','LineWidth',2,'EdgeColor','yellow')
patch([5 6 6 5 5]-0.5,[1 1 2 2 1]-0.5,'red', ...
  'FaceColor','none','LineWidth',2,'EdgeColor','yellow')

%%
% Ouch!

%% The Bottom Line 
% All this is a long-winded way of saying that my pick, (2,2),
% is the absolute worst possible choice. Since the merger in 1970,
% there have been _exactly two games_ that ended with (2,2). On December 5,
% 2004, the Buffalo Bills beat the Miami Dolphins 42-32, and on November 4,
% 2012 the Tampa Bay Buccaneers defeated the Oakland Raiders by the same
% score.
%
% Incidentally, the actual winning result for Steelers-Packers Super Bowl,
% (1,5), is also quite rare. Rare as these things go, but still eleven
% times more likely than (2,2). 
% 
% Not that I'm bitter about it.

##### SOURCE END ##### c52d932239354ddabeadec30b05742fe
-->]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2013/01/07/football-squares-with-matlab/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MATLAB Christmas Trees</title>
		<link>http://blogs.mathworks.com/community/2012/12/21/matlab-christmas-trees/</link>
		<comments>http://blogs.mathworks.com/community/2012/12/21/matlab-christmas-trees/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 15:32:53 +0000</pubDate>
		<dc:creator>Helen Chen</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Christmas]]></category>

		<guid isPermaLink="false">http://blogs.mathworks.com/community/?p=1908</guid>
		<description><![CDATA[While online doing some last minute shopping, I found some Christmas trees that were created using MATLAB.  I thought they are perfect to share with everyone in our community during this holiday season. What a perfect gift if you are still looking for something for someone special! You can even get the MATLAB code to create [...]]]></description>
			<content:encoded><![CDATA[<p>While online doing some last minute shopping, I found some Christmas trees that were created using MATLAB.  I thought they are perfect to share with everyone in our community during this holiday season. What a perfect gift if you are still looking for something for someone special! You can even get the MATLAB code to create your own version!</p>
<p>From <a title="Christmas tree by Marc Latzel" href="http://www.mathworks.com/matlabcentral/fileexchange/9337">XMas Tree</a>, this tree was created by Marc Latzel on File Exchange.</p>
<p><img style="-webkit-user-select: none;" src="http://www.mathworks.com/matlabcentral/fx_files/9337/1/xtree.jpg" alt="" width="340" height="310" /></p>
<p>Also from File Exchange, Anselm shares his <a title="Christmas Tree Plot by Anselm" href="http://www.mathworks.com/matlabcentral/fileexchange/22478-a-christmas-tree-plot">Christmas Tree Plot</a>.</p>
<p><img style="-webkit-user-select: none;" src="http://www.mathworks.com/matlabcentral/fx_files/22478/1/untitled.png" alt="" width="304" height="340" /></p>
<p>From YouTube, <a title="A musical Christmas tree by gknor" href="http://www.youtube.com/watch?v=TIrzjTmAyOs">gknor </a>has shared his <a title="MATLAB Xmas Tree Animation by gknor" href="http://www.youtube.com/watch?v=TIrzjTmAyOs">MATLAB Xmas Tree Animation</a>.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/TIrzjTmAyOs" frameborder="0" allowfullscreen></iframe></p>
<p>Do you have a favorite MATLAB Christmas tree? Vote for one of these trees or share a link to your own creation as <a href="http://blogs.mathworks.com/community/?p=1908#respond" title="Vote for your favorite tree!">a comment below</a>.</p>
<p><b>Happy holidays to everyone from the <a href="http://blogs.mathworks.com/community" title="Do you speak MATLAB Blog">Do You Speak MATLAB blog</a> team!</b></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.mathworks.com/community/2012/12/21/matlab-christmas-trees/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
