Figure window full screen from live script editor not working

Working in R2024a, with live scripts, i have run into an issue with some of the wasy i would get figures to open full screen automatically
Method 1 is my defulat method and has worked in the past on R2020, but no longer is beahving as expected. I have tried several other methods also with no success
a sample code of what i am doing and description of teh restuls i get based on the most recomended approaches ive seen
x =[1 2 3 4 5];
y = x + 1;
%method 1
f(10) = figure('units','normalized','outerposition',[0 0 1 1]);
plot(x,y)
% opens in bottom left corner ~10% of screen cut off by task bar
%method 2
f(20) = figure();
plot(x,y)
set(gcf, 'Position', get(0, 'Screensize'));
% opens in bottom left corner ~10% of screen cut off by task bar
%method 3
f(30) = figure();
plot(x,y)
set(gcf,'Position',get(0,Screensize'));
% does not work at all % Unrecognized function or variable 'Screensize'.

 採用された回答

Adam Danz
Adam Danz 2025 年 4 月 30 日
編集済み: Adam Danz 2025 年 10 月 2 日

1 投票

I believe your workflow is to generate the figures in the mlx file and then to open the figure window using the interactive button in the upper right corner of the figure.
I tested your methods 1 and 2 in R2024a which resulted in the window opening in the bottom left of the monitor as you described. I also tested these methods in R2024b where the figure window opens maximized as expected. Thus, this appears to have been fixed in R2024b.
The problem with method 3 is shown by the error message. "Screensize" needs to be a string.
If the goal is to generate a maximized figure from a live script, set the figure's Visible property to "on".
figure(Visible="on",WindowState="maximized")

3 件のコメント

Arhum
Arhum 2025 年 4 月 30 日
編集済み: Arhum 2025 年 4 月 30 日
yes, that is the work flow i am using, i should have included that from the start
thank you, have you by chance been ab le to test it on 2025A?
If i am going to the effort of updating, i might as well just go to the latest version
Adam Danz
Adam Danz 2025 年 4 月 30 日
編集済み: Adam Danz 2025 年 5 月 1 日
Yes, tested in R2025a as well where figure size is as expected. Good to go.
Arhum
Arhum 2025 年 5 月 1 日
thank you

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2024a

質問済み:

2025 年 4 月 30 日

編集済み:

2025 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by