Finding unique dates in vector
Mostrar comentarios más antiguos
Hi all.
I have a vector of dates where each date is repeated many times. How would i create a vector with every date but no repetitions efficiently?
Thx.
1 comentario
Jan
el 25 de Mayo de 2011
What exactly means "vector of dates"? Please post the type of the input exactly. I assume that UNIQUE will help you directly.
Respuesta aceptada
Más respuestas (1)
Daniel Svedbrand
el 12 de Mzo. de 2025
Editada: Daniel Svedbrand
el 12 de Mzo. de 2025
0 votos
unique_dates = unique(dateshift(Date,'start','day'));
if Date are datetimes, otherwise
unique_dates = unique(dateshift(datetime(Date),'start','day'));
Categorías
Más información sobre Time Series Objects 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!