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..
2 ビュー (過去 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!