check whether a Simulink handle is a block or model programmatically

1 回表示 (過去 30 日間)
giga
giga 2016 年 2 月 3 日
回答済み: Subhadra Mahanti 2016 年 2 月 4 日
I have a handle to a block/model which I have retrieved programmatically. Is there a way (e.g. calling get_param) to programmatically figure out whether it's handle of a block or model (or of any other type)?
Thanks

採用された回答

Subhadra Mahanti
Subhadra Mahanti 2016 年 2 月 4 日
Shafiul To determine whether a handle (say h) is that of a block or model, just query its type:
get_param(h,'Type')
For a model, the above query will return block_diagram, while for a block it will return block.

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by