File Exchange

image thumbnail

Redraw lines in simulink v1

version 1.0 (1.25 KB) by

This simple function redraws the lines in (the top level) simulink.

1 Download


View License

For each block in the simulink diagram, it finds the inports. For each inport the function searches for the corresponding source port.

it deletes the line, then redraws it using either autorouting on or off.

Comments and Ratings (3)

jun hua

where can I get more info about SrcPortHandle and DstPortHandle? I even can't find them in matlab help file.


Thijs (view profile)

Mostly yes, I personally used it when automatically generating simulink models. depending on the complexity of the model I found it usefull to switch between autorouting on or off. In a simpel model 'off' resulted in the best look, but in slightly more complex ones that resulted in a spider web like tangle of lines, in this case the orthogonal look using autorouting was better looking.

I also use it when I forget my mouse, and have to rely on a mousepad, as it can be difficult to connect the lines neatly if one source block is connected to multiple destinations (i.e. when you cant use ctrl+click to quickly connect blocks).


K E (view profile)

What is the reason that one would redraw the lines? To clean up the block diagram?

MATLAB Release
MATLAB 7.13 (R2011b)

Inspired: Simulink Manipulation Utilities

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today