I am reading data from an IMU sensor and i am plotting it live by using:
"ax = subplot(m,n,iPlot);
linePlot = plot(ax, 0,[NaN NaN NaN]);"
where dataplot is a growing array which contains all data points received from the IMU.
I need to make the code more time efficient, and was wondering two things:
- how can i limit the plot to only show the last 500 points.
- is there a more efficient way to save the data from the sensor without having an always growing array of data? say is the a way to send the data to an outer struct and reset the parameter?