(ongoing...)
While creation Simulink diagram, specifically while designing a module,
it might be very useful to quickly organize inside a Simulink system inports with outports and subsystems.
This is the role of Organize current system functionality :
Note the goto/from option. The other lines option is explained in the next step 4e.
In this step 4d, we focus on the goto/from option.
To get the principle of the Organize functionality, open module pbOrganize_training_vU0. You have :
As you can see, considering that signal naming drive signals, then :
inport 1 of the current Simulink system named input1 is expected entering the inport 1 of the subsystem subsystem
inport 2 of the current Simulink system named input2 is not used
outport 1 of the current Simulink system named output1 comes from outport 1 of the subsystem subsystem
Based on this status, on the slTOOL gui, pushing button Organize current system
leads to this automatic layout :
To go further, open module pbOrganize_training_vU1 :
Then, organize this system : '
As this automation is based on naming, if a signal's name is not isvarname in the Matlab sense (see help isvarname in Matlab help),
this signal is discarded and is marked with orange background.
As an example, open module pbOrganize_training_vU2 and organize it, you will get :
In the same way, if two subsystems supplies the same output, they are connected to a red terminator.
As an example on this, open module pbOrganize_training_vU3 and organize it, you will get :
Of course, signals may be exchanged between subsystems, in that case they are connected through goto/from (accordingly to the goto/from option).
As an example on this, open module pbOrganize_training_vU4 and organize it, you will get :
This organize functionality has been illustrated inside a module but can be used anywhere else in a Simulink model.
This organize functionality associated to the disconnect functionality is particularly useful to clean up and arrange some big codes.
As an example on this, open module pbOrganize_training_vU5, you have :
When requested, the Organize functionality first list inports, outports and subystems that have to be treated, i.e. those who are NOT connected at all, all others are discarded and left on the left side.
As a result, if you organize this Simulink SubSystem as it, nothing won't happen because all inports, outports and SubSystems are unconnected :
Then, you can easily disconnect by selecting all the blocks (Ctrl + A) and use disconnect functionality :
Then, you can organize and get :
As the blocks taken into account are inports, outports and subsystems, any other blocks are discarded, which is the case for these from and goto.
Of course, this Organize function is usable in any Simulink system.
In MTX use, this function is useful to design the inside of a module.
This step 4d explained the goto/from option. Next step 4e uses the alternative lines option.