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

3 Ansichten (letzte 30 Tage)
Jonas Richter
Jonas Richter am 23 Sep. 2021
Beantwortet: Suman am 25 Okt. 2024 um 8:36
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 Kommentar
Valentin Stegmaier
Valentin Stegmaier am 15 Mär. 2023
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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Suman
Suman am 25 Okt. 2024 um 8:36
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:

Kategorien

Mehr zu Nonlinear Operators finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by