How do I print a Simulink block's mask dialog?

2 ビュー (過去 30 日間)
Spencer O
Spencer O 2022 年 1 月 20 日
回答済み: Paul 2022 年 1 月 20 日
I need to print the mask dialogs of all my subsystem blocks so that I can capture the parameterization in a report. While I can print the block diagrams under masks, I need help printing the mask dialog itself, or otherwise export the mask parameter values for each block. I need this for Simulink library blocks as well as blocks I have created.

回答 (1 件)

Paul 2022 年 1 月 20 日
Here is a way to get the mask parameters for a masked block, stored in a struct with field names the parameter names and field values the parameter values.
d = get_param(gcb,'DialogParameters'); % replace gcb with the block of interest
params = fieldnames(d);
for ii = 1:numel(params)
blkparam.(params{ii}) = get_param(gcb,params{ii});




Community Treasure Hunt

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

Start Hunting!

Translated by