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

Thread Subject:
drawnow error

Subject: drawnow error

From: cartonn

Date: 28 Jul, 2009 07:09:02

Message: 1 of 3

Hi,

I am working on a 3D visualization and have a 3D graph that I make using "surf" command.
Then, I have a function which I pass the figure handle and a number (lets call it x).
This function rotates the image (using view(az , el)), and uses an exporting function to export this image. (An image takes about 3 min to export)
Somewhere in that exporting function, there is a print command. And after a few images (whereas I have x=15) I get an error saying

Error using ==> print at 310
Error using ==> drawnow
UIJ_AreThereWindowShowsPending - timeout waiting for window to show up

Is this because "surf" and "view" commands are forcing "Figure 1" window to show up?
And more importantly, how can I get around this? Is there a way to prevent windows from showing up or something? (I don't need to see the image, so it won't be a problem if I don't see "Figure 1" window)

thanks..

Subject: drawnow error

From: cartonn

Date: 28 Jul, 2009 09:09:01

Message: 2 of 3

Also, when I try to use this procedure with a low -what I call- precision_multiplier, it takes less time to

"surf" the figure, display it and export it;
rotate it using "view", display it and export it;
rotate it using "view", display it and export it;
...
...
... n times
and quit

Because it takes less time to display the figure, I get no errors, no WindowShowsPending or anything.. I think it might work if I can increase that time limit for pending windows. But I don't know how to do that either..

(again, I don't need to "literally display" the figure. I just need it to be there)

any help would be appreciated.

Subject: drawnow error

From: cartonn

Date: 28 Jul, 2009 14:01:18

Message: 3 of 3

all right, I found a solution. It's not exactly what I was looking for, but it works just fine.

I added "set(gcf, 'visible', 'off')" after every "surf" and "view" command. Problem seems to be solved..

Tags for 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