I found out all the mask blocks in my model. Now how to remove these masks?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Akshat
el 30 de Sept. de 2023
Editada: Akshat
el 30 de Sept. de 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.
0 comentarios
Ver también
Categorías
Más información sobre Author Block Masks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!