{"id":8988,"date":"2017-12-01T09:00:27","date_gmt":"2017-12-01T14:00:27","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=8988"},"modified":"2018-01-16T08:33:51","modified_gmt":"2018-01-16T13:33:51","slug":"line-goto-from-tool","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2017\/12\/01\/line-goto-from-tool\/","title":{"rendered":"Line &#8211; Goto From Tool"},"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\/59742-line-goto-from-tool\">Line &#8211; Goto From Tool<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/6052287\">McSCert<\/a>.\n      <\/p>\n<p>   <\/introduction><\/p>\n<p>While reading <a href=\"https:\/\/blogs.mathworks.com\/simulink\/2017\/11\/27\/highlight-to-source-and-destination-a-new-way-to-navigate-your-model\/\">Guy&#8217;s post<\/a> about the new signal highlighting capabilities in R2017b, I was reminded of this nice utility.\n   <\/p>\n<p>If you would like to declutter your model, this tool can help.  Here is a simple model with five lines going between two subsystems.<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/original_model.png\"> <\/p>\n<p>After following the installation instructions in the provided pdf to add the utility to the path before starting Simulink,<br \/>\n      it&#8217;s as simple as selecting a line and right-clicking:\n   <\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/rightclick.png\"> <\/p>\n<p>It will prompt for a signal name which you can provide and then create the goto-from tags.<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/gotos.png\"> <\/p>\n<p>If you&#8217;d like to use buses instead of using from\/gotos, you could use another <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2017b\/simulink\/release-notes.html?rntext=&amp;startrelease=R2017b&amp;endrelease=R2017b&amp;category=Component-Based+Modeling&amp;groupby=release&amp;sortby=descending\">new feature<\/a> in Simulink to take the five lines and convert them into a bus.\n   <\/p>\n<p>Simply highlight the lines and hit the ellipsis that pops up:<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/createbus.png\"> <\/p>\n<p>And select &#8220;Create Bus&#8221;<\/p>\n<p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/createdbus.png\"> <\/p>\n<h3>Comments<a name=\"2\"><\/a><\/h3>\n<p>Give it a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=8988#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59742-line-goto-from-tool#comments\">comment<\/a> for McSCert.\n   <\/p>\n<p><script language=\"JavaScript\">\n<!--\n\n    function grabCode_599522609ce445a5ac4f65c71b1e9b7d() {\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='599522609ce445a5ac4f65c71b1e9b7d ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 599522609ce445a5ac4f65c71b1e9b7d';\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 2017 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_599522609ce445a5ac4f65c71b1e9b7d()\"><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><!--\n599522609ce445a5ac4f65c71b1e9b7d ##### SOURCE BEGIN #####\n%% Line - Goto From Tool\n%\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59742-line-goto-from-tool Line - Goto From Tool> by\n% <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/6052287 MsCSert>.\n% \n\n%% \n% While reading\n% <https:\/\/blogs.mathworks.com\/simulink\/2017\/11\/27\/highlight-to-source-and-destination-a-new-way-to-navigate-your-model\/\n% Guy's post> about the new signal highlighting capabilities in R2017b, I\n% was reminded of this nice utility.\n%\n% If you would like to declutter your model, this tool can help.  Here is a\n% simple model with five lines going between two subsystems.\n%\n% <<original_model.png>>\n%\n% After following the installation instructions in the provided pdf to add the\n% utility to the path before starting Simulink, it's as simple as selecting\n% a line and right-clicking:\n%\n% <<rightclick.png>>\n%\n% It will prompt for a signal name which you can provide and then create\n% the goto-from tags.\n%\n% <<gotos.png>>\n%\n% Additionally, you could use another\n% <https:\/\/www.mathworks.com\/help\/releases\/R2017b\/simulink\/release-notes.html?rntext=&startrelease=R2017b&endrelease=R2017b&category=Component-Based+Modeling&groupby=release&sortby=descending\n% new feature> in Simulink to take the five lines and convert them into a\n% bus.\n%\n% Simply highlight the lines and hit the ellipsis that pops up:\n%\n% <<createbus.png>>\n%\n% And select \"Create Bus\"\n%\n% <<createdbus.png>>\n\n\n%% Comments\n% \n% Give it a try and let us know what you think\n% <https:\/\/blogs.mathworks.com\/pick\/?p=8988#respond here> or leave a\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/59742-line-goto-from-tool#comments\n% comment> for MsCSert.\n%\n \n\n##### SOURCE END ##### 599522609ce445a5ac4f65c71b1e9b7d\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/Sean\/mainlinegoto\/original_model.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>Sean&#8216;s pick this week is Line &#8211; Goto From Tool by McSCert.<\/p>\n<p>While reading Guy&#8217;s post about the new signal highlighting capabilities in R2017b, I was reminded of this&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2017\/12\/01\/line-goto-from-tool\/\">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,24,28],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8988"}],"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=8988"}],"version-history":[{"count":5,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8988\/revisions"}],"predecessor-version":[{"id":9354,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8988\/revisions\/9354"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=8988"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=8988"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=8988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}