Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show matlab figures automatically on the second monitor [duplicate]

I have a computer with a second monitor connected under "extended" mode.

When I start my matlab script it will show a figure. In a default mode, the figure always shows on the monitor of my computer. However, instead, I would like for the figure to show directly on the extended monitor. I'd also like for the figure to show with its maximum size.

I searched, but did not get much luck to find a answer. Anyone here care to enlighten me? Thanks a lot.

like image 567
Nick X Tsui Avatar asked Dec 12 '25 06:12

Nick X Tsui


1 Answers

Open a new figure. Place and resize it where you want on the second monitor. Then do the following. Now any new figure should be spawned there.

pos = get (gcf, 'position');
set(0, 'DefaultFigurePosition', pos)

Note this will only keep for your current matlab session. So if you want this behavior always you can add it to your startup.m file or create one if you dont have o e already.

like image 179
Aero Engy Avatar answered Dec 15 '25 10:12

Aero Engy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!