Filter table data by character string

12 ビュー (過去 30 日間)
peterhack
peterhack 2016 年 11 月 10 日
回答済み: Alexandra Harkai 2016 年 11 月 10 日
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 == '?????',:)

採用された回答

Alexandra Harkai
Alexandra Harkai 2016 年 11 月 10 日
November = data(11 == month(data.date),:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by