extract data in specific interval

I have one table with two columns: date (01-01-2010 to 31-08-2021), value
I would like to get only data during 2020. There is a function or similar to get some only data in specific period?

 采纳的回答

Let thedates be your datetime array.
[y,m,d,h,m,s] = datevec(thedates) ;
iwant = thedates(y==2020)
You can also use inequalities like ==, >, <, >=, <= on these dates.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品

版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by