Finding unique dates in vector
显示 更早的评论
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 个评论
Jan
2011-5-25
What exactly means "vector of dates"? Please post the type of the input exactly. I assume that UNIQUE will help you directly.
采纳的回答
更多回答(1 个)
Daniel Svedbrand
2025-3-12
编辑:Daniel Svedbrand
2025-3-12
0 个投票
unique_dates = unique(dateshift(Date,'start','day'));
if Date are datetimes, otherwise
unique_dates = unique(dateshift(datetime(Date),'start','day'));
类别
在 帮助中心 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!