Help subsetting data from a .nc file
8 次查看(过去 30 天)
显示 更早的评论
I have a netcdf file, presenting lat and long as 182x149 matrices each, and then SST data presented as 182x149xtime, with time being number of days. I am trying to subset all three matrices to specific ranges (specifically lats between 8 and 40, and longs between 270 and 300). When i subset my lat and long, the results are 1 dimensional matrices of indices, and thus I cannot use them to in turn subset the SST data. Here's my current code to subset lat and long:
lat = ncread('tos_IPSL.nc', 'lat'); long = ncread('tos_IPSL.nc', 'lon'); %%Here matrices are 182x149
my_lat=find(lat>8 & lat<40); my_long=find(long>270 & long<300); lat_subset=lat(my_lat); long_subset=long(my_long); %%These are now 3638x1 for lat and 2243x1 for long
This unfortunately means I cannot use them to subset my SST files... any help would be greatly appreciated!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NetCDF 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!