Change system mask "Icon" section programmatically

Hi,
I'm trying to create the mask of a model programmatically and edit the "Icon" section, for the moment I have the following script:
I want the script to edit this part of the mask:
I can't find anything in the documentation on how to do that.
Is it possible ?
Thanks

5 件のコメント

Aabha
Aabha 2025 年 6 月 13 日
You could try using the following command to modify the icon section of the mask:
set_param(blockHandle, 'MaskDisplay', 'plot(0:1)');
N/A
N/A 2025 年 6 月 13 日
Hi @Aabha,
What's blockHandle value ? I tried to set it like:
blockHandle = load_system(my_model)
but it fails on the set_param :
Aabha
Aabha 2025 年 6 月 13 日
The 'blockHandle' needs to be the handle of the block that you are trying to modify. In this case, since you want to modify the icon for a mask, you can use the following command to get the block handle value:
handle = get_param(blockPath, 'Handle');
Please ensure that the blockPath is the full path of the mask (i.e., including the model name or parent subsystem) that you are trying to modify.
N/A
N/A 2025 年 6 月 13 日
The problem is that my mask is on the slx model itself, not on a block.
Suppose this is my model test.slx with some blocks inside it, I want the mask to be on test.slx so I can define the inputs/outputs of the model.
N/A
N/A 2025 年 6 月 13 日
Ok so I just created a wrap subsystem of the blocks and I create the mask on it instead of the model itself.
Thanks for your help, @Aabha

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSubsystems についてさらに検索

製品

リリース

R2022b

質問済み:

N/A
2025 年 6 月 11 日

コメント済み:

N/A
2025 年 6 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by