How to distinguish Subsystem and Chart by comparing their block properties in MATLAB 2017b?

3 ビュー (過去 30 日間)
zhichuan wang
zhichuan wang 2018 年 8 月 14 日
コメント済み: zhichuan wang 2018 年 11 月 14 日
  • Firstly, due to the different block properties 'LibraryVersion' in MATLAB 2016a, I can distinguish them.
Subsystem:
get_param(gcbh,'LibraryVersion')
ans =
0×0 empty
Chart:
get_param(gcbh,'LibraryVersion')
ans =
'1.267'
  • Secondly, the chart property 'LibraryVersion' is set to null in MATLAB 2017b. Therefore, most of their properties are the same.
The question is how can I find the difference between Subsystem and Chart by using m scripts .

回答 (1 件)

Arunkumar M
Arunkumar M 2018 年 11 月 9 日
You can use type property of the objects in simulink model. For subsystem, it will be Type: 'block' and for stateflow chart, it will be Type: 'Stateflow'
  1 件のコメント
zhichuan wang
zhichuan wang 2018 年 11 月 14 日
Hi, Arunkumar
Thanks for your answer. I've compared the type property of Subsystem and Chart with the command (get(gcbh)) in MATLAB 2017b. But they are still the same as follows.
...
Type: 'block'
Parent: 'Test/CurrZeroDriftCal'
...
BlockType: 'SubSystem'
...

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

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by