MATLAB: How to set the gui width as the screen width

guiposition;

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

Best Answer

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.
Related Question