Filter löschen
Filter löschen

Unmask ALL the masks in a model

7 Ansichten (letzte 30 Tage)
Ubaldo
Ubaldo am 22 Sep. 2016
Bearbeitet: Paras Kapoor am 4 Okt. 2016
Hi all, I have a fairly large model, and I need to unmask all the masked blocks. Going through the model and to manually unmask one-by-one all the masked blocks is nearly impossible. Is there a way to do it automatically?
Many thanks!

Antworten (1)

Paras Kapoor
Paras Kapoor am 4 Okt. 2016
Bearbeitet: Paras Kapoor am 4 Okt. 2016
There are 2 types of mask :
1. Functional : It contains its own parameters. You have to manually unmask them because parameters used inside the mask have to be saved in Matlab workspace.
2. Graphical : It is just a display of block. No use of parameters.
Below is a script to run while your model is open. It will remove all the graphical masks automatically.
sys = bdroot;
load_system(sys);
BlockNames = find_system(sys);
val = hasmask(BlockNames);
graphical = find(val==1);
functional = find(val==2);
for i = 1:length(graphical)
name = char(BlockNames(graphical(i)));
p = Simulink.Mask.get(name);
p.delete;
end

Kategorien

Mehr zu Author Block Masks finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by