{"id":2856,"date":"2018-05-15T07:17:29","date_gmt":"2018-05-15T12:17:29","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=2856"},"modified":"2018-05-07T07:20:59","modified_gmt":"2018-05-07T12:20:59","slug":"pause-again","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2018\/05\/15\/pause-again\/","title":{"rendered":"Pause Again"},"content":{"rendered":"\r\n<div class=\"content\"><!--introduction--><p>I recently wrote about the relatively new <a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/04\/08\/pausing-for-a-favorite-feature-of-r2016a\/\">Pause button<\/a> on the Editor portion of the MATLAB Toolstrip. Let's pause again to think about how we can exploit the awesome Pause button on the toolbar.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#6cf03f1b-713a-44a5-a453-004e0d56a3e1\">Possible Uses of the Pause Button<\/a><\/li><li><a href=\"#a7097969-be7e-4d2d-bf6a-c675ef71e6f8\">How Nifty Is That!<\/a><\/li><\/ul><\/div><h4>Possible Uses of the Pause Button<a name=\"6cf03f1b-713a-44a5-a453-004e0d56a3e1\"><\/a><\/h4><p>I already told you how you might use this button, of course, while your code is running.  But there's even more you can do than I mentioned earlier.<\/p><p>You can also<\/p><div><ul><li>do several related tasks, <b>while the code is running<\/b> (i.e., a pause is not required)<\/li><\/ul><\/div><div><ul><li>peek and see what's going on,<\/li><li>then use <tt>profile on<\/tt>,<\/li><li>continue,<\/li><li>wait a bit,<\/li><li>then pause again, and, finally,<\/li><\/ul><\/div><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2018\/pauseSmall.png\" alt=\"\"> <\/p><div><ul><li>use <tt>profile report<\/tt><\/li><\/ul><\/div><div><ul><li>open some other file to look at while the code is running<\/li><li>set some more breakpoints <b>while code is running<\/b><\/li><\/ul><\/div><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2018\/breakpoint1.png\" alt=\"\"> <\/p><p>and the right thing will happen.  You can set the breakpoint by<\/p><div><ul><li>a right click of your mouse in the area in on the left in the editor that is green, then<\/li><li>a breakpoint selection<\/li><\/ul><\/div><h4>How Nifty Is That!<a name=\"a7097969-be7e-4d2d-bf6a-c675ef71e6f8\"><\/a><\/h4><p>What actions to you take while using the Pause button in MATLAB?  Let us know <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=2856#respond\">here<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_aed2496c148f4ad5aec7dc80cc582588() {\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='aed2496c148f4ad5aec7dc80cc582588 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' aed2496c148f4ad5aec7dc80cc582588';\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        copyright = 'Copyright 2018 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 copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\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     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_aed2496c148f4ad5aec7dc80cc582588()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2018a<br><\/p><\/div><!--\r\naed2496c148f4ad5aec7dc80cc582588 ##### SOURCE BEGIN #####\r\n%% Pause Again\r\n% I recently wrote about the relatively new\r\n% <https:\/\/blogs.mathworks.com\/loren\/2016\/04\/08\/pausing-for-a-favorite-feature-of-r2016a\/\r\n% Pause button> on the Editor portion of the MATLAB Toolstrip.  \r\n% Let's pause again to think about how we can exploit the awesome Pause\r\n% button on the toolbar.\r\n\r\n%% Possible Uses of the Pause Button\r\n% I already told you how you might use this button, of course, while your\r\n% code is running.  But there's even more you can do than I mentioned\r\n% earlier.\r\n% \r\n% You can also\r\n%\r\n% * do several related tasks, *while the code is running* (i.e., a pause is\r\n% not required)\r\n%\r\n% *    peek and see what's going on,\r\n% *    then use |profile on|, \r\n% *    continue,\r\n% *    wait a bit,\r\n% *    then pause again, and, finally, \r\n%\r\n% <<pauseSmall.png>>\r\n%\r\n% * use |profile report|\r\n% \r\n% * open some other file to look at while the code is running\r\n% * set some more breakpoints *while code is running*\r\n%\r\n% <<breakpoint1.png>>\r\n%\r\n% and the right thing will happen.  You can set the breakpoint by\r\n% \r\n% * a right click of your mouse in the area in on the left in the editor\r\n% that is green, then\r\n% * a breakpoint selection\r\n%\r\n%% How Nifty Is That!\r\n% What actions to you take while using the Pause button in MATLAB?  Let us\r\n% know <https:\/\/blogs.mathworks.com\/loren\/?p=2856#respond here>.\r\n\r\n\r\n\r\n\r\n##### SOURCE END ##### aed2496c148f4ad5aec7dc80cc582588\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2018\/pauseSmall.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>I recently wrote about the relatively new <a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/04\/08\/pausing-for-a-favorite-feature-of-r2016a\/\">Pause button<\/a> on the Editor portion of the MATLAB Toolstrip. Let's pause again to think about how we can exploit the awesome Pause button on the toolbar.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2018\/05\/15\/pause-again\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[39,6,13],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2856"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=2856"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2856\/revisions"}],"predecessor-version":[{"id":2860,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/2856\/revisions\/2860"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=2856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=2856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=2856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}