I found out all the mask blocks in my model. Now how to remove these masks?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Akshat
2023-9-30
编辑:Akshat
2023-9-30
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!