Effacer les filtres
Effacer les filtres

Equivalent function to 'year'?

2 vues (au cours des 30 derniers jours)
Kate
Kate le 9 Juil 2013
but my matlab doesn't have it (I live in the world of science)
>> help year
year not found.
any ideas? I'd like to use this fileshare function to do climatology stats:
or perhaps someone can offer another idea for aggregating daily data to months and running simple stats on it (ex: mean). I have a time vector and I have the infrastructure to extract data from a specific climate region:
tv=datenum([1980 1 1 0 0 0]):datenum([2009 12 31 0 0 0]);
idx=find(D);
for ii=idx
[I J]=ind2sub(size(glob_climatology),ii);
x=squeeze(glob_climatology(I,J,:));
end
Thanks!

Réponses (1)

Kelly Kearney
Kelly Kearney le 9 Juil 2013
To break down the date into year, month, etc...
dv = datevec(t);
year = dv(:,1);
month = dv(:,2);

Catégories

En savoir plus sur Weather and Atmospheric Science dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by