So I have an app, where I am collecting external data from 16 different sources. This data is constantly being updated, and I would like to have some sort of plot to show this data over time.
In essence, I have 16 different data sets, each with a value, and a timestamp.I would like these data sets to be plotted as different data series. As the data is collected, I update my UI. Currently, when I am updating my UI, I am replotting the entire data set for each data set. This gets very slow at even small numbers of data (i.e. over 5 mintues of data collection, I need this to run for a week).
This is what I want my graph output to look like (here I only have 3 data series, for debugging and testing purposes).
This is how I am updating my UI (everytime a data value is collected):
data = get_CV()
for ii = 1:numel(fieldnames(data))
field_name = strcat("ring", int2str(ii));
if isempty(data.(field_name).timestamp) ~= 1
time_axis = datetime(data.(field_name).timestamp,'InputFormat','dd-MMM-yyyy HH:mm:ss');
data_axis = data.(field_name).analyzed;
scatter(measurement_graph, time_axis, data_axis);
As you can see, I am replotting ALL THE DATA each time.
I can't figure out a way just to plot the new collected data every time.
Does anyone have an idea how I can go about doing this? I would really like to have a visualization of the data while the data is collecting, but if this won't be feasible I'll make do.
Any advice is GREATLY appreciated!!