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?

1 回表示 (過去 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 Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by