MATLAB Answers

0

How to obtain the parameters of more than one mask at the same time

Asked by LÜTFÜ EMRE EFE on 9 Oct 2019
Latest activity Answered by Samatha Aleti on 18 Oct 2019
I have 5 masks in a model and I want to get these parameters at once.
I can get one masks parameters by using this code
  1. Get mask as an object using a masked block’s path.p = Simulink.Mask.get('myModel/Subsystem');
  2. Get a mask parameter by using its name.param = p.getParameter('intercept');
but How can I get the all parameters of all mask at once

  0 Comments

Sign in to comment.

1 Answer

Answer by Samatha Aleti on 18 Oct 2019
 Accepted Answer

Use the following command to get the list of mask parameters of a block:
get_param('model/sub_block', 'DialogParameters')
To get the values of the masked parameters, you may write as folllows:
dialogPrms = get_param('model/sub_block', 'DialogParameters');
dialogPrmNames = fieldnames(dialogPrms); % Parameter names
for idx = 1:numel(dialogPrmNames)
dialogPrmValue = get_param('model/sub_block', dialogPrmNames{idx}) % Parameter values
end

  0 Comments

Sign in to comment.