subsetting dates in a matrix
이전 댓글 표시
Hello,
I have a time series in a matrix and first column is serial date numbers (up to millisecond precision), and other columns my samples. I would like to get those rows that belong to for example '12-Oct-2012'. I couldn't figure out how to write the logical operator to get a slice of this matrix. I would like to hopefully avoid some sort of slow string comparison.
Thanks in advance
댓글 수: 2
Azzi Abdelmalek
2013년 11월 1일
Show the two first rows of your data
Cagdas Ozgenc
2013년 11월 1일
편집: Cagdas Ozgenc
2013년 11월 1일
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2013년 11월 1일
If A is your cell array
c1=cellstr(datestr(A(:,1),'dd-mm-yyyy'))
idx=ismember(c1,'12-10-2012')
out=A(idx,:)
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!