Is there a command to generate the parameter values for all user-defined parameters in a specific block instead of a different command for each parameter?

2 次查看(过去 30 天)
I know how to use the command: paramValue = get_param('Name of model/Name of block', 'Name of block parameter') to generate the value of a specific parameter for a block within a simulink model. Is there a command that generates the value of all user-defined parameters within a single block? For example, if I had a sine wave block in simulink and wanted to use matlab to generate the values of the amplitude, frequency, bias, phase, etc., I would have to write a line of code for each parameter. I want to be able to write one line of code and generate all of these values.

回答(1 个)

Kumar Pallav
Kumar Pallav 2021-10-27
Hi,
You can try the following command to get a list of block dialog parameters.
get_param('mymodel/myblock','DialogParameters')
You can get the values of any block parameter from the list by using the following command:
get_param('mymodel/myblock','ParameterName')
Please refer this document for more details on 'get_param'.

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by