Change the visibility flag of a picture inside a Simulink mask via command window

3 ビュー (過去 30 日間)
Björn Bobe
Björn Bobe 2019 年 8 月 8 日
コメント済み: Björn Bobe 2019 年 8 月 14 日
how can i change the visibility flag of a picture inside a Simulink mask via command window?
Finally i would like to do the following:
Inside a Masked-Subsystem i would like to display a certain picture occording to the settings made inside Mask.

回答 (2 件)

Maadhav Akula
Maadhav Akula 2019 年 8 月 12 日
編集済み: Maadhav Akula 2019 年 8 月 12 日
You can set all the Mask properties using the Simulink.Mask class object from the command line. Use these links for Simulink.Mask class and How to Control Masks programatically: -
I hope when you mentioned ‘visibility flag’, you meant the Icon Transparency tab in Mask editor, which corresponds to IconOpaque property in Simulink.Mask class.
If by ‘Inside a Masked-Subsystem’, you meant about displaying an image on the Mask Icon then you can go to Mask->Edit Mask(Ctrl+M) and in the Icon Drawing pane, you can write the code for your Image. For example :-
Mobjt = Simulink.Mask.get('test/Sub');%Creating a Mask object for required Subsystem
if strcmp(Mobjt.IconOpaque,'on')%When the Icon Transparency is Opaque
A = imread('1.jpg');%Read the required image
image(A);%Displaying it on the Mask
else %When the Icon Transparency is Transparent
B = imread('2.jpg'); %Read the required image
image(B);%Displaying it on the Mask
end
But, if you want to display your Image inside the Subsystem then you can create another Subsystem(inside the Subsystem) and repeat the same steps as above.
You can also look in the following link below on How to Draw Mask Icon : -
Hope this helps!
  1 件のコメント
Björn Bobe
Björn Bobe 2019 年 8 月 14 日
Thanks for your feedback!
Regrettably i did not indent to modify the MaskDisplay. I would like to display pictures inside a mask of a subsystem where the picture is changing occording to the mask settings (like displayed Swap_pictures.jpg attached).
To achieve this goal i would like to control the picture_visibility flag (like manually done in mask_dialog.jpg )

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


Björn Bobe
Björn Bobe 2019 年 8 月 14 日
Thanks for your feedback!
Regrettably i did not indent to modify the MaskDisplay. I would like to display pictures inside a mask of a subsystem where the picture is changing occording to the mask settings (like displayed Swap_pictures.jpg attached).
To achieve this goal i would like to control the picture_visibility flag (like manually done in mask_dialog.jpg )

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by