Finding unique dates in vector
Afficher commentaires plus anciens
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 commentaire
Jan
le 25 Mai 2011
What exactly means "vector of dates"? Please post the type of the input exactly. I assume that UNIQUE will help you directly.
Réponse acceptée
Plus de réponses (1)
Daniel Svedbrand
le 12 Mar 2025
Modifié(e) : Daniel Svedbrand
le 12 Mar 2025
0 votes
unique_dates = unique(dateshift(Date,'start','day'));
if Date are datetimes, otherwise
unique_dates = unique(dateshift(datetime(Date),'start','day'));
Catégories
En savoir plus sur Time Series Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!