Real time data in MATLAB

2 views (last 30 days)
rahul manocha
rahul manocha on 17 Nov 2013
Commented: Walter Roberson on 18 Nov 2013
I have a piece of code that collects data from a hardware. I am trying to display the data real time. The hardware gives data every 1/512 sec. But plotting the data makes the system really slow. Is there a way to plot real time data using multithreading or multiprocessing, such that the data rate is not affected plot is remains real time.

Answers (1)

Walter Roberson
Walter Roberson on 17 Nov 2013
Well, not really. But some ways of collecting data are more efficient than others. How are you reading the data at present?
  2 Comments
rahul manocha
rahul manocha on 17 Nov 2013
Edited: Walter Roberson on 18 Nov 2013
I have a .dll library provided by the hardware vendor. I callib function to acquire data. It runs perfectly when I dont plot. But when I create a handle for a plot and update the handle everytime new data is acquired, it takes around 10sec for getting 1sec of data.
set(Hraw,'YData',raw);
axis(hr,[j1 j1+1023 -200 300]);
drawnow;
if(rem(Fraw,1024)==0)
j1=j1+1024;
end
here raw is data acquired. Hraw is handle to a plot and I showing only 1024 readings at a time
Walter Roberson
Walter Roberson on 18 Nov 2013
Is "raw" the data that was acquired in that instance, or is it all the accumulated data since the beginning? Is it really required to update the display 512 times per second?

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!