Filter table data by character string

12 Ansichten (letzte 30 Tage)
peterhack
peterhack am 10 Nov. 2016
Beantwortet: Alexandra Harkai am 10 Nov. 2016
Assume I have the following data:
date = datetime - days(1:5:21)' + hours(randn(5,1));
x = randn(5,1);
y = randn(5,1);
data = table(date,x,y)
data =
date x y
____________________ ________ ________
09-Nov-2016 17:08:01 -1.0891 0.085931
04-Nov-2016 14:49:53 0.032557 -1.4916
30-Oct-2016 15:58:21 0.55253 -0.7423
25-Oct-2016 15:22:32 1.1006 -1.0616
20-Oct-2016 16:43:06 1.5442 2.3505
How can I filter for all rows with entrys in column date including a string "Nov", so that I get all the data for November?
November = data(data.date == '?????',:)

Akzeptierte Antwort

Alexandra Harkai
Alexandra Harkai am 10 Nov. 2016
November = data(11 == month(data.date),:)

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by