Programmatically maximize simulink window

4 ビュー (過去 30 日間)
skamajaya
skamajaya 2024 年 9 月 30 日
編集済み: Voss 2024 年 9 月 30 日
we can change the location and rezie the simulink window by this code
set_param(gcs,'location',[0 0 1920 1100])
however, it actually different than "maximizing" window.
is there any parameter to "maximize" simulink window?

採用された回答

Arjun
Arjun 2024 年 9 月 30 日
I see that you want to maximize the Simulink window in a programmatic way using MATLAB code.
I do not see a direct way to maximize the Simulink window, however you can achieve a similar effect by making the Simulink window size match the size of your screen.
You can use the “get” function to retrieve the screen size and then set the parameters accordingly.
You can refer to the code snippet below:
% Get the screen size, 0 will fetch the size of your primary screen
screenSize = get(0, 'ScreenSize');
% Set the Simulink window location to match the screen size
set_param(gcs, 'Location', [0 0 screenSize(3) screenSize(4)]);
I hope this helps!
  2 件のコメント
skamajaya
skamajaya 2024 年 9 月 30 日
it could be interesting workarond, even tough i need to subtract with estimated toolbar size manually.
do you know how to the size of second or third display ?
Voss
Voss 2024 年 9 月 30 日
編集済み: Voss 2024 年 9 月 30 日
"do you know how to the size of second or third display ? "
The root property MonitorPositions contains the sizes (and locations) of all displays.
pos = get(groot(),'MonitorPositions')

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by