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:
Plotting while function is still running

Subject: Plotting while function is still running

From: Yan Rosh

Date: 2 May, 2011 16:39:05

Message: 1 of 3

I have a function that runs continuously and operates some voltage generators through GPIB. Once in a while I need to plot some of the data, the problem is that the graph is invisible, and only after the program closes the graph is printed out.

What I need the program to do is run continuously and once in a while plot some data. Once more data needs to be plotted I want to clear the figure and plot the new data...

Unfortunately I don't really know how to do this so I would really appreciate some help...

Thanks!

Subject: Plotting while function is still running

From: Steven_Lord

Date: 2 May, 2011 16:55:35

Message: 2 of 3



"Yan Rosh" <yan_rosh@yahoo.DOT.com> wrote in message
news:ipmmn9$4b4$1@fred.mathworks.com...
> I have a function that runs continuously and operates some voltage
> generators through GPIB. Once in a while I need to plot some of the data,
> the problem is that the graph is invisible, and only after the program
> closes the graph is printed out.
>
> What I need the program to do is run continuously and once in a while plot
> some data. Once more data needs to be plotted I want to clear the figure
> and plot the new data...

Give MATLAB a chance to process the plotting command using DRAWNOW inside
your loop.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Plotting while function is still running

From: Yan Rosh

Date: 4 May, 2011 06:19:04

Message: 3 of 3

Thanks!
The DRAWNOW and PAUSE functions sorted this out...


"Steven_Lord" <slord@mathworks.com> wrote in message <ipmnm7$ko6$1@fred.mathworks.com>...
>
>
> "Yan Rosh" <yan_rosh@yahoo.DOT.com> wrote in message
> news:ipmmn9$4b4$1@fred.mathworks.com...
> > I have a function that runs continuously and operates some voltage
> > generators through GPIB. Once in a while I need to plot some of the data,
> > the problem is that the graph is invisible, and only after the program
> > closes the graph is printed out.
> >
> > What I need the program to do is run continuously and once in a while plot
> > some data. Once more data needs to be plotted I want to clear the figure
> > and plot the new data...
>
> Give MATLAB a chance to process the plotting command using DRAWNOW inside
> your loop.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

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