How to change information overlays programmatically in Simulink?

5 ビュー (過去 30 日間)
Frank F.
Frank F. 2024 年 9 月 5 日
コメント済み: Frank F. 2024 年 9 月 11 日
In the course of the changeover in our system from Matlab r2018b to r2023b, we are currently looking through all MAAB3 rules. We are using a self-written rule na_0004 (na_0004: Simulink model appearance settings) to check the model appearance in Simulink.
One part of this rule is to set all "Information Overlays" in Simlulink a way we want. To do that, we need to access them programmatically.
In the attachment you will find a picture, which shows parameters marked in green, which we cannot change programmatically, because we cannot find the corresponding parameter names and their possible settings in the documentation.
Is there a way to change these parameters programmatically and what are their basic settings?
We would also like to know how to access the StatusBar and the Toolbar in 2023b and how to switch them on or off.

回答 (1 件)

Andy Bartlett
Andy Bartlett 2024 年 9 月 5 日
Use get_param and set_param on the model.
The harder part is figuring out the name of the parameter you want to change. Documentation and Tab completion can help there.
mdlName = 'mySillyModelName';
new_system(mdlName)
open_system(mdlName)
curShowPortDataTypes = get_param(mdlName,'ShowPortDataTypes') % Tip: Use tab-completion on last parameter to see a list of choices
curShowPortDataTypes = 'off'
set_param(mdlName,'ShowPortDataTypes','on') % Tip: Use tab-completion on last parameter to see a list of choices
newShowPortDataTypes = get_param(mdlName,'ShowPortDataTypes')
newShowPortDataTypes = 'on'
  1 件のコメント
Frank F.
Frank F. 2024 年 9 月 11 日
Hello,
Thank you for your reply.
I have found most of the parameter names I was looking for, but one is still missing.
I can't find a parameter name that allows me to set the ‘toolbar’ / ‘toolstrip’ to ‘on’ or ‘off’.
Maybe someone knows the name?
thanks in advance

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

カテゴリ

Help Center および File ExchangeMAB Modeling Guidelines についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by