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!