Friday, July 31, 2009

drawnow

Complete pending drawing events

Syntax

  • drawnow

Description

drawnow flushes the event queue and updates the figure window.

Remarks

Other events that cause MATLAB to flush the event queue and draw the figure windows include:

  • Returning to the MATLAB prompt
  • A pause statement
  • A waitforbuttonpress statement
  • A waitfor statement
  • A getframe statement
  • A figure statement

Examples

Executing the statements,

  • x = -pi:pi/20:pi;
    plot(x,cos(x))
    drawnow
    title('A Short Title')
    grid on

as an M-file updates the current figure after executing the drawnow function and after executing the final statement.

No comments:

Post a Comment