Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
grouping measures by time
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a problem to extract data from a cell array.
The array has 4 columns:
1 - date (ex. '27-May-2013') 2 - time (ex. '09:47:39') 3 - category (1-36) 4 - measures
I need to separate the 36 categories and sum the measures every 10 minutes.
The frequency acquisition is not constant (approximately one measure/10 seconds). I tried to make the sum of the measures every 10 minutes (00:10:00), but I am not able to obtain a constant grouping at perfectly 00:10:00.
It is not a problem if I will have different numbers of measures in each 10 minutes interval, but the interval need to be exactly 00:10:00.
Do you have any suggestions?
Thank you
0 Kommentare
Antworten (1)
Amit
am 30 Jan. 2014
Your cell column 1 and 2 represent date and time. you can use datenum to determine time difference. for example (assuming you cell array is named A):
formatIn = 'dd-mmm-yyyy HH:MM:SS'; % I am assuming the months are 3 letters only
time_in = datenum([A{1,1} ' ' A{1,2}],formatIn); % This will give you a numerical value
time_2 = datenum([A{i,1} ' ' A{i,2}],formatIn); % This will give you a numerical value
You have to loop through until
(time_2 - time_in)*24*60 <= 10
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!