Finding unique dates in vector
Ältere Kommentare anzeigen
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 Kommentar
Jan
am 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.
Akzeptierte Antwort
Weitere Antworten (1)
Daniel Svedbrand
am 12 Mär. 2025
Bearbeitet: Daniel Svedbrand
am 12 Mär. 2025
0 Stimmen
unique_dates = unique(dateshift(Date,'start','day'));
if Date are datetimes, otherwise
unique_dates = unique(dateshift(datetime(Date),'start','day'));
Kategorien
Mehr zu Time Series Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!