필터 지우기
필터 지우기

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 CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by