how to find the parameter name for any block in the simulink to use it in set_param command?
10 次查看(过去 30 天)
显示 更早的评论
I want to set a value of 5 in the "step time" parameter in the "step" block from the mfile, the name of the model of simulink is "plant1"
i wrote in the command window:
set_param('plant1/Step','step time',5)
but there is an error:
Step block does not have a parameter named 'step time'
my question: what is the name of the 'step time' parameter which can be used in set_param command?
and, in general how can i reach to the name of each parameter in each block easily?
0 个评论
回答(1 个)
Monika Jaskolka
2021-3-1
编辑:Monika Jaskolka
2021-3-3
To programmatically find out what parameters a block has, get its handle:
h = get_param(gcb, 'Handle');
or
h = gcbh;
and then use the get command to see a list of all its parameters and their current values:
get(h)
You can also take a look at the Block-Specific Parameters page. The parameter names are listed, as well as their possible values.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!