How to extract data according to date ?

1 回表示 (過去 30 日間)
Vikash Raj
Vikash Raj 2022 年 1 月 27 日
コメント済み: Vikash Raj 2022 年 1 月 30 日
I have a large file containing data for one whole month. I have two separate column vectors of data where one is timestamp in the form '2016-02-01 00:19:09 ' and second vector is Vtec data. I want to analyse the data by days. I want to select the data for first 4 days and with corresponding Vtec data and then plot the graph and then next 4 days until I complete the month. I was using this code but it is giving me a error
idx = ( '2016-02-01 00:19:09 '<= TM2 & TM2 <'2016-02-05 00:00:00 ' );
Any suggestions on this matter will be highly appreciated.

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 1 月 28 日
Convert your dates to datetime and use isbetween.
idx = isbetween(TM2,datetime(2016,02,01,00,19,09),datetime(2016,02,05,00,00,00));
  1 件のコメント
Vikash Raj
Vikash Raj 2022 年 1 月 30 日
Thank you. It is working.

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

その他の回答 (0 件)

カテゴリ

Help Center および 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