{"id":11499,"date":"2020-05-04T08:54:35","date_gmt":"2020-05-04T12:54:35","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=11499"},"modified":"2020-05-04T10:31:08","modified_gmt":"2020-05-04T14:31:08","slug":"matlab-r2020a","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2020\/05\/04\/matlab-r2020a\/","title":{"rendered":"MATLAB R2020a"},"content":{"rendered":"<div xmlns:mwsh=\"http:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction>\r\n      <p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2020a\/documentation-center.html\">MATLAB R2020a<\/a> by MathWorks' Development.\r\n      <\/p>\r\n   <\/introduction>\r\n   <h3>Contents<\/h3>\r\n   <div>\r\n      <ul>\r\n         <li><a href=\"#2\">New Profiler<\/a><\/li>\r\n         <li><a href=\"#3\">Export and Copy Graphics<\/a><\/li>\r\n         <li><a href=\"#4\">Geoglobe<\/a><\/li>\r\n         <li><a href=\"#5\">Generate Code in Diagnostic Feature Designer<\/a><\/li>\r\n         <li><a href=\"#6\">Added Events<\/a><\/li>\r\n         <li><a href=\"#7\">Comments<\/a><\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <p>MATLAB R2020a shipped about a month and half ago so here are some of my favorite features in the new release!<\/p>\r\n   <h3>New Profiler<a name=\"2\"><\/a><\/h3>\r\n   <p>There is a newer interface to the <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/profiling-for-improving-performance.html\">MATLAB Profiler<\/a> which also provides a flame graph view of where the time is being spent.  This allows you to quickly identify areas that\r\n      are taking a lot of time.  I've found it really helps with seeing inside of graphics computations, for example, the amount\r\n      of time spent creating a 'Toolbar', in the below example.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/flamegraph.png\"> <\/p>\r\n   <h3>Export and Copy Graphics<a name=\"3\"><\/a><\/h3>\r\n   <p>Have you wanted to quickly copy a plot into PowerPoint or an email?  In R2020a there are new commands <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/copygraphics.html\"><tt>copygraphics<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/exportgraphics.html\"><tt>exportgraphics<\/tt><\/a> to quickly and accurately get your graphics onto the clipboard or into an image.  The new functions are easier to use, seem\r\n      to generally do the right thing, and allow you to pass in just an axes or chart rather than having to export the whole figure\r\n      or deal with <i>PaperPosition<\/i>, etc.\r\n   <\/p>\r\n   <p>Here's an exported image for a new <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/boxchart.html\"><tt>boxchart<\/tt><\/a>, which brings <tt>boxplot<\/tt> from the Statistics Toolbox to base MATLAB.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/boxchart.png\"> <\/p>\r\n   <h3>Geoglobe<a name=\"4\"><\/a><\/h3>\r\n   <p>In the Mapping Toolbox, there's a new graphics addition called <a href=\"https:\/\/www.mathworks.com\/help\/map\/ref\/geoglobe.html\">geoglobe<\/a> that makes it easy to draw lines on the surface of\r\n      the Earth and interact with it.  This would be a great way for <a href=\"https:\/\/blogs.mathworks.com\/loren\/2020\/01\/14\/how-to-chart-my-year\/\">Loren to Chart Her Year<\/a> during a normal travel year.\r\n   <\/p>\r\n   <p>Here's a plot from MathWorks' Headquarters to the antipode (a word I just learned last week!).<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/antipodeglobe.gif\"> <\/p>\r\n   <h3>Generate Code in Diagnostic Feature Designer<a name=\"5\"><\/a><\/h3>\r\n   <p>The <a href=\"https:\/\/www.mathworks.com\/help\/predmaint\/ref\/diagnosticfeaturedesigner-app.html\">Diagnostic Feature Designer<\/a> app in the Predictive Maintenance Toolbox is a really powerful way to generate, explore, and rank statistical features based\r\n      on time or frequency.  It's really useful for any machine learning problem with a signal or time series input, not just limited\r\n      to predictive maintenance applications.\r\n   <\/p>\r\n   <p>Until R2020a, you could use the app to generate and rank features, but any features you designed had to be recoded by hand\r\n      which could be non-trivial and prone to error.  Now you can generate code to automate or scale everything you've done in the\r\n      app.\r\n   <\/p>\r\n   <h3>Added Events<a name=\"6\"><\/a><\/h3>\r\n   <p>Finally, a more esoteric feature I personally requested - you can <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.mock.testcase.createmock.html#mw_6d0ee35e-47c0-4215-922c-08fd2d11526a\">add events<\/a> to a mock object.  I was struggling to create a situation to fire an event to test that an app updated correctly.  I was\r\n      already using a mock to speed up the computation and having it throw an event would've worked really well.  The testing development\r\n      team turned this request around in less than a year.\r\n   <\/p>\r\n   <p>If you're interested in mocking, also check out <a href=\"https:\/\/blogs.mathworks.com\/developer\/2017\/07\/06\/dont-mock-me\/\">this blog post<\/a> on our developer zone blog.  If you have a feature you want and a good use case, please contact support and request it so\r\n      they can prioritize the work!\r\n   <\/p>\r\n   <h3>Comments<a name=\"7\"><\/a><\/h3>\r\n   <p>Give R2020a a try and let us about your favorite features <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=11499#respond\">here<\/a>.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_41744e49b1eb430eb0af48a9c2608355() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='41744e49b1eb430eb0af48a9c2608355 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 41744e49b1eb430eb0af48a9c2608355';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Sean de Wolski';\r\n        copyright = 'Copyright 2020 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_41744e49b1eb430eb0af48a9c2608355()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2020a<br><\/p>\r\n<\/div>\r\n<!--\r\n41744e49b1eb430eb0af48a9c2608355 ##### SOURCE BEGIN #####\r\n%% MATLAB R2020a\r\n%\r\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s\r\n% pick this week is\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2020a\/documentation-center.html\r\n% MATLAB R2020a> by MathWorks' Development.\r\n% \r\n\r\n%% \r\n% MATLAB R2020a shipped about a month and half ago so here are some of my\r\n% favorite features in the new release!\r\n%\r\n\r\n%% New Profiler\r\n%\r\n% There is a newer interface to the\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/profiling-for-improving-performance.html\r\n% MATLAB Profiler> which also provides a flame graph view of where the time\r\n% is being spent.  This allows you to quickly identify areas that are\r\n% taking a lot of time.  I've found it really helps with seeing inside of\r\n% graphics computations, for example, the amount of time spent creating a\r\n% 'Toolbar', in the below example.\r\n%\r\n% <<flamegraph.png>>\r\n\r\n%% Export and Copy Graphics\r\n%\r\n% Have you wanted to quickly copy a plot into PowerPoint or an email?  In\r\n% R2020a there are new commands\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/copygraphics.html\r\n% |copygraphics|> and\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/exportgraphics.html\r\n% |exportgraphics|> to quickly and accurately get your graphics onto the\r\n% clipboard or into an image.  The new functions are easier to use, seem to\r\n% generally do the right thing, and allow you to pass in just an axes or\r\n% chart rather than having to export the whole figure or deal with\r\n% _PaperPosition_, etc.\r\n%\r\n% Here's an exported image for a new\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/boxchart.html |boxchart|>,\r\n% which brings |boxplot| from the Statistics Toolbox to base MATLAB.\r\n%\r\n% <<boxchart.png>>\r\n\r\n%% Geoglobe\r\n%\r\n% In the Mapping Toolbox, there's a new graphics addition called geoglobe\r\n% that makes it easy to draw lines on the surface of the Earth and interact\r\n% with it.  This would be a great way for\r\n% <https:\/\/blogs.mathworks.com\/loren\/2020\/01\/14\/how-to-chart-my-year\/ Loren\r\n% to Chart Here Year> during a normal travel year.\r\n%\r\n% Here's a plot from MathWorks' Headquarters to the antipode (a word I just\r\n% learned last week!).\r\n%\r\n% <<antipodeglobe.gif>>\r\n%\r\n\r\n\r\n%% Generate Code in Diagnostic Feature Designer\r\n%\r\n% The\r\n% <https:\/\/www.mathworks.com\/help\/predmaint\/ref\/diagnosticfeaturedesigner-app.html\r\n% Diagnostic Feature Designer> app in the Predictive Maintenance Toolbox is\r\n% a really powerful way to generate, explore, and rank statistical features\r\n% based on time or frequency.  It's really useful for any machine learning\r\n% problem with a signal or time series input, not just limited to\r\n% predictive maintenance applications.\r\n%\r\n% Until R2020a, you could use the app to generate and rank features, but\r\n% any features you designed had to be recoded by hand which could be\r\n% non-trivial and prone to error.  Now you can generate code to automate or\r\n% scale everything you've done in the app.\r\n\r\n\r\n%% Added Events\r\n%\r\n% Finally, a more esoteric feature I personally requested - you can\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/ref\/matlab.mock.testcase.createmock.html#mw_6d0ee35e-47c0-4215-922c-08fd2d11526a\r\n% add events> to a mock object.  I was struggling to create a situation to\r\n% fire an event to test that an app updated correctly.  I was already using\r\n% a mock to speed up the computation and having it throw an event would've\r\n% worked really well.  The testing development team turned this request\r\n% around in less than a year.\r\n%\r\n% If you're interested in mocking, also check out\r\n% <https:\/\/blogs.mathworks.com\/developer\/2017\/07\/06\/dont-mock-me\/ this blog\r\n% post> on our developer zone blog.  If you have a feature you want and a\r\n% good use case, please contact support and request it so they can\r\n% prioritize the work!\r\n\r\n\r\n%% Comments\r\n% \r\n% Give R2020a a try and let us about your favorite features \r\n% <http:\/\/blogs.mathworks.com\/pick\/?p=11499#respond here>.\r\n \r\n\r\n##### SOURCE END ##### 41744e49b1eb430eb0af48a9c2608355\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/flamegraph.png\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n   \r\n      Sean's pick this week is MATLAB R2020a by MathWorks' Development.\r\n      \r\n   \r\n   Contents\r\n   \r\n      \r\n         New... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2020\/05\/04\/matlab-r2020a\/\">read more >><\/a><\/p>","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11499"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=11499"}],"version-history":[{"count":5,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11499\/revisions"}],"predecessor-version":[{"id":11521,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/11499\/revisions\/11521"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=11499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=11499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=11499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}