{"id":140,"date":"2011-05-24T18:56:32","date_gmt":"2011-05-24T18:56:32","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2011\/05\/24\/making-things-easier\/"},"modified":"2011-05-24T18:56:32","modified_gmt":"2011-05-24T18:56:32","slug":"making-things-easier","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2011\/05\/24\/making-things-easier\/","title":{"rendered":"Making things easier"},"content":{"rendered":"<p>With every release, we add new capabilities to improve the usability of Simulink. In R2011a, there is a good list of enhancements that should make your life a little bit easier. Here are a few examples:<\/p>\r\n\r\n<strong><p>Creating protected models via right-click<\/p><\/strong>\r\n\r\n<p>In R2009b, <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009b\/toolbox\/simulink\/ug\/br6xrii.html\">protected model reference<\/a> was introduced. To use this feature, you had to use the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/slref\/simulink.modelreference.protect.html\">Simulink.ModelReference.protect<\/a> command to generate the protected model, then drag a model reference block from the Simulink Library and specify the name of the newly created file.<\/p>\r\n\r\n<p>In R2011a, all you have to do is right-click on the Model Reference block to protect and select <em>Code Generation -> Generate Protected Model<\/em>.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q2\/RightClickonModelReference.png\" alt=\"Protecting a referenced model\"><\/p>\r\n\r\n<p>A protected model is saved in the current directory and a new model is created with a Model Reference block already configured.<\/p>\r\n\r\n<strong><p>Creating MATLAB structures from the Bus Editor<\/p><\/strong>\r\n\r\n<p>Since R2010a, it is possible to use a MATLAB structure to specify<a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/ug\/bsff8zh.html#bsff871\"> initial conditions of a bus signal<\/a>. When you have a <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/slref\/simulink.bus.html\">bus object<\/a> in the workspace, you can use <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/slref\/simulink.bus.creatematlabstruct.html\">Simulink.Bus.createMATLABStruct<\/a> to automatically create the structure. In R2011a, a menu item and a toolbar button have been added to the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/ug\/brin2jr-1.html\">Bus Editor<\/a> to invoke <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/slref\/simulink.bus.creatematlabstruct.html\">Simulink.Bus.createMATLABStruct<\/a>:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q2\/CreateMATLABStruct.png\" alt=\"Creating a MATLAB Structure from the Bus Editor\"><\/p>\r\n\r\n\r\n<strong><p>Model Reference Parameter dialog box displays model names of all variant choices<\/p><\/strong>\r\n\r\n<p><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011a\/toolbox\/simulink\/ug\/bskoahv-1.html\">Model Reference Variants<\/a> were introduced in R2009b. Before R2011a, the table of variant choices had 2 columns: Variant object and Condition. This means that to see the associated model on the right, you had to click on each variant individually:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q2\/MdlRefNameR2010b.png\" alt=\"pre R2010b Model Reference Parameter dialog box\"><\/p>\r\n\r\n<p>In R2011a, a column has been added to see the model associated with each variant:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q2\/MdlRefNameR2011a.png\" alt=\"Improved R2011a Model Reference Parameter dialog box\"><\/p>\r\n\r\n\r\n<strong><p>Now it's your turn<\/p><\/strong>\r\n\r\n<p>Are you going to take advantage of these enhancements? Do you have suggestions to improve the usability of Simulink? Leave a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=140&amp;#comment\">comment here<\/a>.<\/p>\r\n\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>With every release, we add new capabilities to improve the usability of Simulink. In R2011a, there is a good list of enhancements that should make your life a little bit easier. Here are a few... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2011\/05\/24\/making-things-easier\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[33,16],"tags":[199,198,197],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/140"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}