I have data for five different years, I need to separate each year separately? what's the best possible way? I tried using datnum command..
조회 수: 7 (최근 30일)
이전 댓글 표시
displaytime = datenum(time)-732313 I used this code and it gives me the data for all five years but I need the data for each year separately.
댓글 수: 2
KSSV
2015년 10월 16일
on what variable name the data is stored? Data you mean, it is in a text file? If so, what is the name of text file? You have to be more lcear about how the data is.
채택된 답변
Ingrid
2015년 10월 16일
편집: Ingrid
2015년 10월 16일
you should not use datenum but datevec as then the year is stored in the first column
timeVector =datevec(time);
timeYear = timeVector(:,1);
possibleYears = unique(timeYear);
datePerYear = cell(numel(possibleYears));
for ii = possibleYears
datePerYear{ii} = time(timeYear ==ii);
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!