{"id":9362,"date":"2018-03-16T09:00:16","date_gmt":"2018-03-16T13:00:16","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=9362"},"modified":"2018-03-15T16:30:10","modified_gmt":"2018-03-15T20:30:10","slug":"autofromtag","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2018\/03\/16\/autofromtag\/","title":{"rendered":"AutoFromTag"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\n   <introduction><\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>&#8216;s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40117-autofromtag\">AutoFromTag<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1245158\">Mike Anthony<\/a>.\n      <\/p>\n<p>   <\/introduction><\/p>\n<p>Similar to my <a href=\"https:\/\/blogs.mathworks.com\/pick\/2017\/12\/01\/line-goto-from-tool\/\">blog post<\/a> about converting Simulink lines to goto\/from blocks, I figured I&#8217;d point out this other nice utility for working with goto\/from.<br \/>\n      Mike&#8217;s utility adds a context menu item to the canvas right-click that creates a from tag for the goto tag you have highlighted.<br \/>\n       The from tag inherits the format of the goto.\n   <\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/autofromtag.gif\"> <\/p>\n<p>More recent releases of Simulink have a builtin mechanism for creating from and goto tags as well.  To use it, hover over<br \/>\n      the from or goto block and a light blue block arrow will appear on the side.  Click and drag it to create the block.\n   <\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/builtingotofrom.gif\"> <\/p>\n<h3>Comments<a name=\"3\"><\/a><\/h3>\n<p>Give it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=9362#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40117-autofromtag#comments\">comment<\/a> for Mike.\n   <\/p>\n<p><script language=\"JavaScript\">\n<!--\n\n    function grabCode_bb771ce553b141cb9055fcea5509e1e9() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='bb771ce553b141cb9055fcea5509e1e9 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' bb771ce553b141cb9055fcea5509e1e9';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        author = 'Sean de Wolski';\n        copyright = 'Copyright 2018 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('\n\n<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\n\\n');\n      \n      d.title = title + ' (MATLAB code)';\n      d.close();\n      }   \n      \n-->\n<\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><a href=\"javascript:grabCode_bb771ce553b141cb9055fcea5509e1e9()\"><span style=\"font-size: x-small;        font-style: italic;\">Get<br \/>\n            the MATLAB code<br \/>\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>      Published with MATLAB&reg; R2017b<\/p>\n<\/div>\n<p><!--\nbb771ce553b141cb9055fcea5509e1e9 ##### SOURCE BEGIN #####\n%% AutoFromTag\n%\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40117-autofromtag AutoFromTag> by\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1245158 Mike Anthony>.\n% \n\n%% \n%\n% Similar to my\n% <https:\/\/blogs.mathworks.com\/pick\/2017\/12\/01\/line-goto-from-tool\/ blog\n% post> about converting Simulink lines to goto\/from blocks, I figured I'd\n% point out this other nice utility for working with goto\/from.  Mike's\n% utility adds a context menu item to the canvas right-click that creates a\n% from tag for the goto tag you have highlighted.  The from tag inherits\n% the format of the goto.\n%\n% <<autofromtag.gif>>\n\n%% \n% More recent releases of Simulink have a builtin mechanism for creating\n% from and goto tags as well.  To use it, hover over the from or goto block\n% and a light blue block arrow will appear on the side.  Click and drag it\n% to create the block.\n%\n% <<builtingotofrom.gif>>\n\n\n%% Comments\n% \n% Give it a try and let us know what you think\n% <https:\/\/blogs.mathworks.com\/pick\/?p=9362#respond here> or leave a\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40117-autofromtag#comments\n% comment> for Mike.\n%\n \n\n##### SOURCE END ##### bb771ce553b141cb9055fcea5509e1e9\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/autofromtag.gif\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Sean&#8216;s pick this week is AutoFromTag by Mike Anthony.<\/p>\n<p>Similar to my blog post about converting Simulink lines to goto\/from blocks, I figured I&#8217;d point out this other nice&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2018\/03\/16\/autofromtag\/\">read more >><\/a><\/p>\n","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\/9362"}],"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=9362"}],"version-history":[{"count":5,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9362\/revisions"}],"predecessor-version":[{"id":9560,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/9362\/revisions\/9560"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=9362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=9362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=9362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}