Finding unique dates in vector
Mostra commenti meno recenti
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 Commento
Jan
il 25 Mag 2011
What exactly means "vector of dates"? Please post the type of the input exactly. I assume that UNIQUE will help you directly.
Risposta accettata
Più risposte (1)
Daniel Svedbrand
il 12 Mar 2025
Modificato: Daniel Svedbrand
il 12 Mar 2025
0 voti
unique_dates = unique(dateshift(Date,'start','day'));
if Date are datetimes, otherwise
unique_dates = unique(dateshift(datetime(Date),'start','day'));
Categorie
Scopri di più su Time Series Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!