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..
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dayne Davey
el 16 de Oct. de 2015
Comentada: Dayne Davey
el 19 de Oct. de 2015
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 comentarios
KSSV
el 16 de Oct. de 2015
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.
Respuesta aceptada
Ingrid
el 16 de Oct. de 2015
Editada: Ingrid
el 16 de Oct. de 2015
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!