File Exchange Pick of the Week

August 12th, 2011

Automatically size and connect blocks

Doug's pick this week is AutoSizeOnConnect by Mike Anthony.

I love the fact that Simulink provides a graphical view of the system being modeled, but being a stickler for clean looking models, I sometimes find myself spending time cleaning up lines, resizing blocks, and other graphical tweaks that aren't related to actually solving the problem I'm working on.

That's why I like my colleague Mike's simple tool that saves some time by automatically updating the number of ports and resizing blocks like mux and demux to quickly provide a clean connection to upstream or downstream blocks. After downloading and installing the code, you simply select the the blocks you want to connect to, right-click and choose AutoSizeOnConnect from the context menu, then click the mux or demux block. The result is a nice clean connection:

AutoSizeOnConnect

I also picked this entry because I think it's a great example of how you can customize the Simulink user interface to help streamline your workflow. Thanks Mike!

Give it a try and let us know what you think here or leave a comment for Mike.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.