I'm trying to extract values from a timetable, based on dates from a datetime array. They have different sizes, the datetime array is shorter, and the dates are not in order. Is there any way to use the datetime values as indexing, or use the find function? Thanks!

 採用された回答

KSSV
KSSV 2021 年 8 月 3 日

1 投票

Multiple options.
  1. You can convert them to datenum and use logical, comparisons.
  2. Convert them into same Datetime calss and use logicals, comparisons.

1 件のコメント

Barnabas Kovacs
Barnabas Kovacs 2021 年 8 月 3 日
Thanks, I'll try the first one! The second one doesn't seem to work for some reason...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by