MATLAB Answers

0

how to count daily events from a time series data

Asked by BATAKRUSHNA SENAPATI on 4 Sep 2019
Latest activity Answered by Akira Agata
on 20 Sep 2019 at 14:12
i have a time series data contains year, month, day, hours, and earthquke . how will i count number of earthquake daily

  2 Comments

Attach here small part your data as 'mat' file.
Reformat your data in timetable and use function retime.
here i attach format of my data below

Sign in to comment.

Tags

2 Answers

Answer by Akira Agata
on 20 Sep 2019 at 14:12
 Accepted 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');

  0 Comments

Sign in to comment.


Answer by BATAKRUSHNA SENAPATI on 20 Sep 2019 at 13:58

here i attach my txt file below

  0 Comments

Sign in to comment.