How to find the most frequently repeated time interval?
Mostrar comentarios más antiguos
Matlab warrior! In the data travels, there is a column with start and end time. Each interval has certain value or zero. I have to find the most repeated time (hot spot) among those travels which is not equal to zero. For ex, among two, 1st interval "06:30"-"07:30", and second "06:00 - 07:00", then hotspot would be "06:30-07:00". I have tried smth like:
load_dumb = zeros(24*60+1,1);
for i = 1:length(end_timedumb)
[~, ~, ~, H, MN, ~] = datevec(st_timesumb(i));
T_Stdumb = H*60+MN+1;
[~, ~, ~, H, MN, ~] = datevec(end_timedumb(i));
T_Enddumb = H*60+MN+1;
if isnan(T_Enddumb)
continue
else
minscale_DCH1(T_Stdumb:T_Enddumb,1) = minscale(T_Stdumb:T_Enddumb,1) + 1;
load_dumb(T_Stdumb:T_Enddumb,1) = load_dumb(T_Stdumb:T_Enddumb,1) + dumb_chargingpower(i);
end
end
TimeM = 1:length(minscale);
TimeH = TimeM/60;
figure
plot(TimeH,load_dumb)
but that gives me only the overall peak that values accumulated among intervals. However, I need to find specific interval that is the most common.
2 comentarios
Turlough Hughes
el 17 de Sept. de 2020
Can you attach some sample data?
Asrorkhuja Ortikov
el 18 de Sept. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!