필터 지우기
필터 지우기

How to get the screen width?

조회 수: 8 (최근 30일)
Mr M.
Mr M. 2015년 11월 12일
댓글: Jan 2015년 11월 13일
Is it possible to set outer position of a figure in normalized units (for example to be equal to 1), than get the width in other units (which has to be the screen width)?

답변 (2개)

Stalin Samuel
Stalin Samuel 2015년 11월 12일

Jan
Jan 2015년 11월 12일
편집: Jan 2015년 11월 13일
Yes, simply try it:
FigH = figure('Units', 'normalized', 'Position', [0,0,1,1]);
drawnow; % Not sure if this is required
set(FigH, 'Units', 'inches');
inchPos = get(FigH, 'Position');
Note that the resolution of the screen matters for the result and this value is defined by the operating system. It could fail on Apple's Retina displays or Windows7 laptops with a userdefined scaling factor, most of all if the computer is connected to a projector.
  댓글 수: 2
Stephen23
Stephen23 2015년 11월 12일
편집: Stephen23 2015년 11월 12일
Beamer -> Projector
"Beamer" is one of the cute words that Germans think is English but isn't really, just like "Handy" and "Oldtimer".
Jan
Jan 2015년 11월 13일
@Stephen: Thanks, it's fixed now. I did neither talk about BMW motor cycles not about cricket.
I took the chance to improve my English by recognizing, that these terms are German: Drive-in, Pullover, Mobbing, Smoking, Streetworker, Basecap, Discounter, No-Go, Public Viewing.
Astonishing.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by