Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Screen size?

Subject: Screen size?

From: Valeriy

Date: 30 Dec, 2011 16:13:08

Message: 1 of 1

Seasons greetings!

I need to know screen size to calculate correct figure dimensions. In Matlab help is clear indication how to find it:
scrsz = get(0,'ScreenSize');

When I use this line of code inside my function I see following error message:
??? Error using ==> get
Invalid handle object.

Error in ==> ShowCCD at 72
scrsz = get(0,'ScreenSize');

But, if I stop execution before this line and run it directly in command window, in debug mode, all is correct, no any error message and screen sizes are correct as well. What is the problem?

Attempt to use following line of code
scrsz = get(0,'MonitorPositions');
failed as well with the same error message.

I am using Matlab R2011a under Win7-32. Result is the same if I run Matlab in compatibility with WinXP SP3 mode or directly.

Thanks in advance for help

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us