I have a time series with continuous measurements of pH. The measurements are every 5 minutes, and the timeseries is a total of 13 days.
I want to find and plot the max and min value for each day, where the max and min values are based on 24 observations of a mean pH/hour.
So far I've been able to get the mean pH per hour, but I don't know how to find the max/min values from these and then plot as a continuous time series.
This is what I've done so far to find the mean pH for every hour:
dnv = [time];
dv6 = datevec(dnv);
dn4 = datenum([dv6(:,1:4) repmat([0 0],size(dv6,1),1)]);
[Du,~,di] = unique(dn4, 'stable');
Means = accumarray(di, pH, , @mean);
Out = [datevec(Du) Means];
de = datetime(Out(:,1:6));
So, how do I find the max and min values with the associated date and time for plotting?