Select rows of timetable based on Month range

1视图(最近30天)
Eric Escoto
Eric Escoto on 23 Sep 2021
Commented: dpb 2021年9月25日
Can someone provide the syntax for selecting monthly rowtimes from a timeteble? I would like to select various months. For example, Nov., Dec., Jan., Feb.
Here is what I'm trying:
“冬季”变量和易发线也被拧紧。
Thanks.
% Create new timetables at differing scales.
% Extract the month record
monthoftt =月(tt.time);
%确定11月至3月之间的记录(1:3和
% 11:12)
wintertime = [1,3;11,12];% [start, end] of desired months
wintermonths = monthofTT >= winter(1) & wintertime <= winter(2);
%在冬季隔离所有行
TTwinter = TT(month(TT.Time(winterrmonths)), :);

Accepted Answer

dpb
dpb on 23 Sep 2021
编辑:dpb on 24 Sep 2021
To use the numeric months,
wintertime = [1:3 11:12];% [start, end] of desired months
TTwinter = TT(ismember(month(TT.Time),wintertime), :);
6 Comments
dpb
dpb 2021年9月25日
当不那么累的时候,很明显...对不起,一开始没有抓住它。

Sign in to comment.

More Answers (0)

下载188bet金宝搏


释放

R2021b

Community Treasure Hunt

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

开始狩猎!