I need help with predicting future values of signal using average, and moving average method?

2 views (last 30 days)
Hi guys, thank you in advance for any help. I have my final paper to write on theme: Estimation of Future Values in Continuous Glucose Monitoring Data. I uploaded here file samples.mat I have problem with doing this in matlab. Table samples.mat contains 2 columns. First has 12x1 array with 12 glucose values (1 value/5min), in total one hour of data. Other column is 6 future values of signal in first column (next half hour data). I need to determine future 6 values of every row in table samples.mat using data from every cell in first column a) using just average of previous values b) using Moving average trend estimation(https://www.mathworks.com/help/econ/moving-average-trend-estimation.html) and i got this link from my profesor but i cant seem to figure it out how to get future values and show them on plot.
- which valuse to use as x axis in plot? time hour, hour and half, or number of samples?? - how to do this in a). i got 6 future values by calculating average of first 12, then added average value in new column/row of that array, then used 12 values and 13th value to calculate next average value, but i get same average all the time (every row of samples table diffferent average)
if true
load('samples.mat');
load('similarsSorted.mat');
%simple average
f=[];
for i=1:32
newCol = samples{i};
for j= 1:6
avg = mean(newCol);
newCol =[newCol; avg];
end
f =[f newCol];
end
title('Normal average data');
plot(f);
end
this is content of my .m file for a).
Please help, I have deadline till friday and my profesor isnt answering on any of my emails. I need help with figuring out if a) is ok or if it can be written better and with getting idea how to do b) using moving average because i have little experience with matlab syntax.
thank you again, Anamaria

Answers (0)

Community Treasure Hunt

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

Start Hunting!