필터 지우기
필터 지우기

How to get all parameters for a Simulink masked system at once?

조회 수: 157 (최근 30일)
Steven Huang
Steven Huang 2012년 11월 13일
댓글: Wahab 2023년 9월 16일
I wonder if there is a way to obtain all parameters in a Simulink masked system. For example, assuming a given masked system with parameters "otype" for "Output data type", "omode" for "Output data mode", and many more. The current to see what parameters existing is right-click the subsystem and select "Edit Mask" to see all parameters and their options.
But this is inconvenient for scripting a Simulink System. It would be handy that if I can use get_param command (or some other commands) to pull all parameters and available options.
The same solution may be applied to built-in blocks, not only masked subsystem. I just happen to encounter the subsystem problem.
Thanks
  댓글 수: 3
Kaustubha Govind
Kaustubha Govind 2012년 11월 13일
According to the documentation, get_param('model/sub_block', 'DialogParameters') should return the "List of names/attributes of block-specific parameters for an unmasked block, or mask parameters for a masked block." - could you please explain why this is not sufficient?
Steven Huang
Steven Huang 2012년 11월 14일
If you try get_param('model/sub_block', 'DialogParameters'), you will see that there is no current value is set to. And if there are options, the options won't show either unless combined with other parameters. In short, scripting is difficult to be automatic.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 11월 16일
I'm assuming that you want to do is get the list of dialog parameters and their values? In that case, you need to write something like:
dialogPrms = get_param('model/sub_block', 'DialogParameters');
dialogPrmNames = fieldnames(dialogPrms);
for idx = 1:numel(dialogPrmNames)
dialogPrmValue = get_param('model/sub_block', dialogPrmNames{idx})
end
  댓글 수: 2
Malu
Malu 2023년 7월 18일
how can we get all the blocks and its dialog parameters and their values?
Wahab
Wahab 2023년 9월 16일
@Malu - try:
get_param(gcb, 'ObjectParameters')

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by