I found out all the mask blocks in my model. Now how to remove these masks?

4 views (last 30 days)
I found out all the mask blocks in my model by using the command.
find_system('model_bame','LookUnderMasks','All','Mask','on','Type','block');
Now how can i remove these masks?

Answers (1)

Akshat
Akshat on 30 Sep 2023
Edited: Akshat on 30 Sep 2023
I understand that you want to remove masks from your model. The command stated by you in the question determines all the mask blocks and returns the output in form of a 'cell' array. With this information in hand, we can leverage the 'set_param' function to remove the masks. To demonstrate my approach, I am considering a shipped model which can be opened by executing the following command in the MATLAB command window.
>> openExample('simulink_masking/DrawMaskIconDrawingCommandsExample')
>> slexMaskDrawingExamples
The above model comprises of 8 mask blocks which can be verified from the output of the following command.
>> allMasks = find_system('slexMaskDrawingExamples','LookUnderMasks', ...
'All','Mask','on','Type','block')
allMasks =
8×1 cell array
All the masks in the model can be deleted by utilizing the 'set_param' function. Here is a code snippet for reference.
% iterate over all masks in model
for i=1:length(allMasks)
set_param(allMasks{i},'Mask','off') % deelte masks
end
save_system('slexMaskDrawingExamples');
I hope this helps.

Categories

Find more on Author Block Masks in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!