How to change the data type of an Inport block ? Eg from 'Inherit: auto' to 'Bus: abc'

3 ビュー (過去 30 日間)
Darshan Reddy
Darshan Reddy 2018 年 2 月 19 日
コメント済み: Birdman 2018 年 2 月 19 日
I am trying to change the data type of Inport blocks from 'Inherit: auto' to 'Bus:'. I want to know if there is any command to do such a thing or how to write a script for it.

採用された回答

Birdman
Birdman 2018 年 2 月 19 日
There are two lines of code for it in command line. First you need to define a bus, and then you need to create its element(since it has 0 elements by default).
InBus=Simulink.Bus;
InBus.Elements=Simulink.BusElement;
These code creates a bus and its element. Then, choose Bus for inport and write InBus.
  4 件のコメント
Darshan Reddy
Darshan Reddy 2018 年 2 月 19 日
:D Many thanks. This is what i was looking for.
Birdman
Birdman 2018 年 2 月 19 日
You are welcome.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by