AutoSizeOnConnect

バージョン 1.8.0.1 (18.1 KB) 作成者: Mike Anthony
Automatically resizes the number of ports on a block for automatic connection.
ダウンロード: 874
更新 2016/9/1

ライセンスの表示

編集メモ: This file was selected as MATLAB Central Pick of the Week

In many cases, Simulink® users have multiple blocks that they wish to connect to a block, particularly mux, demux, and bus creator blocks. The current practice is to drag one of these blocks from the Simulink library browser into the model. The mux block, for example, by default has 2 input ports. If you have 4 blocks that you wish to connect, you must open the mask of the mux block and set the number of inputs to 4. This will then create 4 input ports on the mux block. The user can then select the 4 blocks he/she wishes to connect to the mux block, hold CTRL, and select the mux block to automatically connect all of the blocks.
This function eliminates the manual step of opening the mask and setting the number of desired inports/outports and does that automatically based on the number of blocks the user selected to try to connect.

Open the included Simulink model AutoSizeOnConnect.mdl and follow the instructions therein to see an example of how to use this function.

This functional is especially useful when used in conjunction with AutoSize, which is included in this submission but can also be downloaded separately (see Acknowledgements below).

引用

Mike Anthony (2024). AutoSizeOnConnect (https://www.mathworks.com/matlabcentral/fileexchange/31576-autosizeonconnect), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2011a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersBlock Libraries についてさらに検索
謝辞

ヒントを得たファイル: AutoSize

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.8.0.1

Updated license

1.8.0.0

Update that I think fixes the bug that huang reported. This fix also reduces the number of function calls and should improve performance as well.

1.7.0.0

Fixes error if no blocks are selected.

1.6.0.0

Update to work with Scope blocks!

1.5.0.0

Updates to handle blocks with multiple inports/outports.

1.3.0.0

Updated AutoSizeOnConnect.m to handle Multiple Input blocks with 'NumInputs' property (like the VectorConcatenate block)

1.2.0.0

added acknowledgement reference.

1.1.0.0

Updated references, updated screenshot, and fixed minor typos in the files.

1.0.0.0