MATLAB: How to count daily events from a time series data

earthquake

i have a time series data contains year, month, day, hours, and earthquke . how will i count number of earthquake daily

Best Answer

How about the following?
% Read your text data file
T = readtable('test.txt');
% Create datetime vector
Time = datetime(T.year,T.month,T.day,T.hrs,T.mins,T.sec);
% Calculate daily counts
TT = timetable(Time,ones(size(Time)),'VariableNames',{'Count'});
TT = retime(TT,'daily','sum');