How to set my gui width as the screen width

Hi, I try to set the width of my Gui to the user screen width.
I try: ScreenDimensions = get(0,'ScreenSize'); GuiDimensions = [0 0 ScreenDimensions(4) ScreenDimensions(3)]; set(myGui,'Position',GuiDimensions);
where 'myGui' is the background figure of the gui. It's dont work... i try eval and cast to int.
any idea?
Thanks

 采纳的回答

Just use normalized figure units (range from 0 to 1) and it'll take up the whole screen:
figure('units','norm','Position',[0 0 1 1]);
To get what you have above working (and you're almost there!) you'd have to set the figure units to pixels because that's what the screen size is measured in.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by