How to extract certain time in matrix data
显示 更早的评论
Hi.
I have a 476x160x140 precipittaion data (precip/time,lon,lat), from 1981 to 2011 in nc file. Can I extract certain data for a certain year and time? Its like selyear in CDO but I need to do it in Matlab.
Thank you in advance!
10 个评论
Nurul Ain Basirah Zakaria
2020-10-29
Walter Roberson
2020-10-29
It is not obvious how the 476 precip/time is layed out? Is it like 4 hours a day measured for 17 selected weeks a year??
Nurul Ain Basirah Zakaria
2020-10-29
per isakson
2020-10-29
编辑:per isakson
2020-10-29
Maybe NetCDF/GRIB reader or some other submission to of File Exchange could be useful. The summary includes this paragraph
Technically speaking, MATLAB-CDI consists of mex-interfaces to the CDI library that read GRIB/netCDF. CDI is the basic library underlying the famous CDO (Climate Data Operators) developed by Max-Planck Institut für Meteorologie in Hamburg. The MATLAB-CDI interface package has been developed by The MathWorks Consulting on behalf of the Rossby Centre, SMHI.
Walter Roberson
2020-10-29
30 years, 12 months per year, gives 360 entries. You have 116 extra entries. Even if your 1981-2011 is 31 years, that would still be an extra 476-12*31 = 104 entries.
Nurul Ain Basirah Zakaria
2020-10-29
Walter Roberson
2020-10-29
So row index is (year - 1981)*12+month ?
If you were to
data4 = reshape(YourData, [], 12, size(YourData,2), size(YourData,3));
then rows would correspond to years, and dimension 2 would correspond to months, and dimension 3 would correspond to lon, and dimension 4 would correspond to lat. That might make it easier to do month-by-month comparisons across years.
Nurul Ain Basirah Zakaria
2020-10-29
Walter Roberson
2020-10-29
Yes if you do the reshape then it becomes easy.
Nurul Ain Basirah Zakaria
2020-11-1
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!