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

1 view (last 30 days)
Spencer O
Spencer O on 20 Jan 2022
Answered: Paul on 20 Jan 2022
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.

Answers (1)

Paul on 20 Jan 2022
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!