How to obtain the parameters of more than one mask at the same time
조회 수: 3 (최근 30일)
이전 댓글 표시
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
- Get mask as an object using a masked block’s path.p = Simulink.Mask.get('myModel/Subsystem');
- 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
채택된 답변
Samatha Aleti
2019년 10월 18일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Author Block Masks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!