How to get the port domain or type of a simscape block programmatically?

3 ビュー (過去 30 日間)
Jonas Richter
Jonas Richter 2021 年 9 月 23 日
回答済み: Suman 2024 年 10 月 25 日
Hi I am trying to get information of a simscape block about its port domains. With "domains" I mean, if its a mechanical rotational, electrical,... port. I couldn't find any way to get this information programmatically, maybe there is someone who had this problem before :)
Thanks!!
  1 件のコメント
Valentin Stegmaier
Valentin Stegmaier 2023 年 3 月 15 日
Hi Jonas,
i'm currently dealting with the same problem.
For me using try catch worked using the add_line command. Probably this works for you as well.
It is not the cleanest solution unfortunately. Or did you find any way to work around the problem?
Best
Valentin

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

回答 (1 件)

Suman
Suman 2024 年 10 月 25 日
Hi Jonas,
To get information of Simulink or Simscape blocks, you can use 'get_param' function. You can use 'get_param('blockPath', 'ObjectParameters')' and 'get_param('blockPath', 'DialogParameters')' to see all the properties that can be accessed programmatically.
You may refer to these documentations to learn more:

カテゴリ

Help Center および File ExchangeNonlinear Operators についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by