Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

grouping measures by time

1 visualización (últimos 30 días)
Valerio
Valerio el 30 de En. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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

Respuestas (1)

Amit
Amit el 30 de En. de 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

La pregunta está cerrada.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by