MATLAB: Take individual daily sum of value

daily averageindividual daily average values

I have values for total global radiation and want to make daily average values.
The tricky part is, that the amount of values measured each day with values not equal to zero differs from day to day.
How can i take daily average values for each day individualy?
dt = table2array(T(:,3 )); % Extract the time step array
dt = datetime(dt, 'InputFormat', 'dd-mmm-yyyy HH-MM-SS');
global_radiation = table2array(T(: , 6));
global_radiation = global_radiation .* (1/10^6); % Converting units
% Check for repitions
[C,IA,IC] = unique(dt, 'rows');
dt = dt(IA);
global_radiation = global_radiation(IA);
And then there is this part of code which does not fit:
t = 0:numel(global_radiation)-1 ; % time stamps
interval = 144 ;
ix = 1+floor((t-t(1))/interval);
global_radiation_daily = accumarray(ix(:),global_radiation(:))./144;
Here, the daily average is made out of the summ of all values for one day, also the values wich are zero are taken into account.
Thanks in advance for your help!
Best regards,
Arthur Leon

Best Answer

Look into groupummary.
There is a 'daily' option under groupbins.
Use 'mean' as your method.