{"id":2856,"date":"2011-01-11T14:32:08","date_gmt":"2011-01-11T13:32:08","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=2856"},"modified":"2016-06-13T13:16:54","modified_gmt":"2016-06-13T12:16:54","slug":"whats-new-in-matlab-2010b","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=2856","title":{"rendered":"What&#8217;s new in MATLAB 2010b?"},"content":{"rendered":"<p>MATLAB 2010b was released a couple of months ago and, as usual, it comes with a whole range of new features, performance enhancements and all important bug fixes.\u00a0 Within the MATLAB 2010b documentation, there are lists of the new functionality but I like to dig in a bit deeper and pick out one or two things that are of personal interest to me.<\/p>\n<h3>64 bit integer support<\/h3>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/?p=2629\">Back in April 2010<\/a>, I was working with the <a href=\"http:\/\/www.nag.co.uk\/\">NAG Toolbox for MATLAB<\/a> which makes use of 64 bit integers on 64 bit machines and I learned that MATLAB 2010a and earlier didn&#8217;t support even the most basic of operations on 64 bit integers. For example, on MATLAB 2010a:<\/p>\n<pre>a=int64(10);\r\nb=int64(20);\r\na+b\r\n??? Undefined function or method 'plus' for input arguments of type 'int64'.<\/pre>\n<p>I&#8217;m happy to report that this has now been fixed and The Mathworks have implemented 18 basic operators for 64bit integer types including arithmetic, the colon operator, bsxfun and more.\u00a0 This has made my life (and the lives of some of the people I support) MUCH easier and I really appreciate The Mathworks work on this one.<\/p>\n<h3>Curve Fitting and Splines toolboxes merged<\/h3>\n<p>MATLAB has got a lot of toolboxes.\u00a0 In fact, it&#8217;s got far too many in my opinion which makes the product more expensive and fragmented.\u00a0 I have literally lost count of the amount of times someone has emailed me with a query like &#8220;I don&#8217;t suppose you have access to the XYZ toolbox because someone had sent me code that uses it and I can&#8217;t run it&#8217;\u00a0 Quite frankly, it sucks.<\/p>\n<p>So, when The Mathworks announce that they are merging the functionality of two related toolboxes into one, there is much rejoicing in Walking Randomly towers.\u00a0 If The Mathworks would like to do some more toolbox merging then <a href=\"https:\/\/www.walkingrandomly.com\/?p=2876\">I have a couple of suggestions<\/a> :)<\/p>\n<h3>CUDA support in the Parallel Computing Toolbox<\/h3>\n<p>These days, the hotness in research computing is to do as much of your calculation as possible on your graphics card.\u00a0 If handled correctly, the hunk of silicon that was originally designed to make games look pretty can speed up scientific calculations hundreds of times compared to dull old CPUs.\u00a0 There is a great deal of interest in GP-GPU programming at Manchester University (my employer), so much so that we have set up a <a href=\"http:\/\/wiki.rcs.manchester.ac.uk\/community\/GPU\/Club\">GPU-Club<\/a> for our researchers.<\/p>\n<p>Arguably, the leader in GP-GPU (General Purpose &#8211; Graphics Processing Unit) hardware is NVIDIA who are the developers of the <a href=\"http:\/\/www.nvidia.com\/object\/cuda_home_new.html\">CUDA programming framework<\/a>.\u00a0 Until now, CUDA support in MATLAB has been provided by third-parties such as <a href=\"http:\/\/www.accelereyes.com\/\">Jacket<\/a> (Commerical) or <a href=\"http:\/\/gp-you.org\/\">GP-You<\/a> (free) but as of 2010b, there is now official support for CUDA GPUs in MATLAB&#8217;s parallel computing toolbox.\u00a0 At the moment, it is not as well developed as products such as Jacket but I would lay bets that this will change in the not too distant future.<\/p>\n<p><a href=\"https:\/\/www.walkingrandomly.com\/?p=2860\">My early experiments<\/a> with this new functionality have met with zero success but I have new hardware on the way and I am really looking forward to getting my teeth into this.<\/p>\n<h3>Parallel Statistics<\/h3>\n<p>Parallel computing in MATLAB is more complicated than it should be.\u00a0 Some functions <a href=\"https:\/\/www.walkingrandomly.com\/?p=1894\">make use of multicore processors automatically<\/a> and you <strong>don&#8217;t<\/strong> need the parallel computing toolbox to feel the benefit.\u00a0 On the other hand, there are an increasing number of functions in toolboxes such as statistics and optimisation, that additionally require the PCT in order to make maximum use of modern hardware.<\/p>\n<p>The 2010b version of the statistics toolbox includes an extra 8 functions (candexch, cordexch, daugment, dcovary, nnmf, plsregress, rowexch and sequentialfs) that now make use of the PCT.\u00a0 If you have the PCT, then this is wonderful news but if you don&#8217;t then there is nothing to see here.<\/p>\n<h3>Faster trig functions when the argument is in degrees<\/h3>\n<p>The standard trigonometric functions such as sin, cos, tan and the like all work in radians but MATLAB also has several functions that accept their arguments in degrees: sind, cosd and tand for example.\u00a0 In MATLAB 2010b these functions have been made significantly faster.\u00a0 Lets see how much faster using my 3Ghz quad Core 2 Q9650 running Ubuntu 9.10<\/p>\n<p>In MATLAB 2010a<\/p>\n<pre>x=rand(1,1000000)*360;\r\n&gt;&gt; tic;y=cosd(x);toc\r\nElapsed time is 0.120207 seconds.\r\n<\/pre>\n<p>In MATLAB 2010b<\/p>\n<pre>x=rand(1,1000000)*360;\r\n&gt;&gt; tic;y=cosd(x);toc\r\nElapsed time is 0.021256 seconds.\r\n<\/pre>\n<p>A speed up of around 5.6 times!\u00a0 What&#8217;s more, I&#8217;ve already come across a user&#8217;s code in the wild where this optimisation made a real difference to their execution time.\u00a0 As far as I can tell, the speed up comes from the fact that 2010a and below uses MATLAB code for these functions whereas 2010b and above uses mex files.<\/p>\n<h3>What other bloggers say about MATLAB 2010b<\/h3>\n<ul>\n<li><a href=\"http:\/\/blogs.mathworks.com\/steve\/2010\/10\/15\/r2010b-image-processing-toolbox-performance-improvements\/\">R2010b &#8211; Image Processing Toolbox performance enhancements<\/a><\/li>\n<li><a href=\"http:\/\/blogs.mathworks.com\/steve\/2010\/10\/29\/r2010b-more-image-processing-toolbox-changes\/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+SteveOnImageProcessing+%28Steve+on+Image+Processing\">R2010b &#8211; More Image Processing Toolbox changes<\/a><\/li>\n<li><a href=\"http:\/\/blogs.mathworks.com\/loren\/2010\/10\/29\/editor-features-in-r2010b\/\">Editor Features in R2010b <\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>MATLAB 2010b was released a couple of months ago and, as usual, it comes with a whole range of new features, performance enhancements and all important bug fixes.\u00a0 Within the MATLAB 2010b documentation, there are lists of the new functionality but I like to dig in a bit deeper and pick out one or two [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,11],"tags":[],"class_list":["post-2856","post","type-post","status-publish","format-standard","hentry","category-math-software","category-matlab"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p3swhs-K4","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/2856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2856"}],"version-history":[{"count":14,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/2856\/revisions"}],"predecessor-version":[{"id":6139,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/2856\/revisions\/6139"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}