So I have flow data in an hourly time period, I was able to calculate the daily mean flow of these hourly values. Now I want to subtract the hourly flow values from the daily flow values to see how much change there is from the mean on a hourly basis.
Here is what I have so far:
Dates=datevec(DateandTime);% Group by day
[unDates, ~, subs] = unique(Dates(:,1:3),'rows');% Accumulate by day
AVG=[unDates accumarray(subs, Flow, [], @mean)];f=AVG(:,4);t=datenum(AVG(:,1:3));figureplot (x,y,t,f,'r')legend('Hourly Flow','Daily Flow','location','best');datetick ('x', 'mm-dd-yy', 'keepticks')xlabel('Time');ylabel('Flow [cfs]');title('Daily Flow');% axis tight
%%Difference from average flow
figuren=datenum(AVG(:,1:3));if n~=x DeltaFlow=Flow-AVG(:,4);end
I keep getting an error matrix do not agree.
Best Answer