How do I maximize the web browser window?

조회 수: 10 (최근 30일)
Paul Smith
Paul Smith 2019년 3월 4일
편집: Paul Smith 2019년 3월 18일
When you create a web window through matlab (like web(Url)) how do you maximise/change the window size in script?
  댓글 수: 3
Paul Smith
Paul Smith 2019년 3월 5일
Windows 10 Enterprise 2015, might be nice to know how to do a unix system too, but Windows first :).
madhan ravi
madhan ravi 2019년 3월 5일

댓글을 달려면 로그인하십시오.

채택된 답변

Paul Smith
Paul Smith 2019년 3월 18일
편집: Paul Smith 2019년 3월 18일
This is what I ended up doing in the end...
web(newUrl,'-browser') %is google chrome
pause(5);
robot = java.awt.Robot;
%maximise window 'hot key' Alt+Space+x
robot.keyPress(java.awt.event.KeyEvent.VK_ALT)
robot.keyPress(java.awt.event.KeyEvent.VK_SPACE)
robot.keyRelease(java.awt.event.KeyEvent.VK_SPACE)
pause(0.5);
robot.keyPress(java.awt.event.KeyEvent.VK_X)
robot.keyRelease(java.awt.event.KeyEvent.VK_X)
robot.keyRelease(java.awt.event.KeyEvent.VK_ALT)

추가 답변 (1개)

Anant Upadhyay
Anant Upadhyay 2019년 3월 7일
According to my knowledge, there is currently no built-in functionality to maximize, minimize or get the state of a figure in MATLAB.
As a workaround for MATLAB 7.4 (R2007a) and later versions, the attached files maxfig.p, minfig.p and figstate.p (with help files maxfig.m, minfig.m and figstate.m) allow you to perform these actions as follows:
minfig(F,1) % Minimizes the figure window for the figure with handle F
minfig(F,0) % Restores figure F if F is minimized
maxfig(F,1) % Maximizes the figure window for the figure with handle F
maxfig(F,0) % Restores figure F if F is maximized
s = figstate(F) % Returns the state of figure { Maximized | Minimized | Normal }
Please note that querying the figure position immediately after using these functions may not work reliably unless the figure resize is complete.
There are no workarounds for versions prior to MATLAB 7.4 (R2007a).
If you are using GUIDE with the Resizable set to off?
Go to: GUIDE->Tools->GUI Options->Resizable Behavior

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by