How to get Simulink block name

9 次查看(过去 30 天)
Alexey
Alexey 2023-8-4
回答: Daniel 2023-8-4
I have this Simulink sample model
I would like to get the block names (Duty cycle D, Input voltage, PWM etc.).
I know that there is Simulink command like get_param(handle,property); which possibly can return that name but what is the name of the param itself?

回答(1 个)

Daniel
Daniel 2023-8-4
As documented in the get_param documentation, BlockPaths = get_param(gcs,'blocks') will return the list of blocks at the level of gcs. Or you can provide the name of your system directly rather than gcs, e.g. 'mymodel' or 'mymodel/path/to/mysubsystem'.

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by