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

조회 수: 7 (최근 30일)
kuldeep kumar
kuldeep kumar 2023년 9월 29일
편집: Akshat 2023년 9월 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?

답변 (1개)

Akshat
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.

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by