extract numbers from time series
조회 수: 2(최근 30일)
표시 이전 댓글
Have a time series from 1 to 156. Want to extract the values from 1:6, then from (1+12) : (6+12), etc into a new variable. How to go about.
채택된 답변
Adam Danz
2018년 8월 13일
I don't know what format your dates are in but this can be adapted to any format. I assume your matrix is named 'data' and the dates are in the 5th column.
% Get the month number for each date
monthNum = month(data(:,5));
% Logical index of rows that are between May and October
monthIdx = ismember(monthNum, [5:10]);
% Extract your data for these months
data(monthIdx, :)
댓글 수: 0
추가 답변(1개)
참고 항목
범주
Find more on Time Series Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!