What version of Matlab are you running? They've introduced some nice higher-level reading and writing functions in more recent versions (R2010 and above, I think). You should be able to get the data quickly via ncread. Based on the file details:
ncdisp(url, '/', 'min')
Source:
http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis/pressure/hgt.1968.nc
Format:
64bit
Variables:
level
Size: 17x1
Dimensions: level
Datatype: single
lat
Size: 73x1
Dimensions: lat
Datatype: single
lon
Size: 144x1
Dimensions: lon
Datatype: single
time
Size: 1464x1
Dimensions: time
Datatype: double
hgt
Size: 144x73x17x1464
Dimensions: lon,lat,level,time
Datatype: int16
you might not want to read in that whole variable all at once (b/c it has a scale factor and offset, it will be read in as a double array). To get one slice at time 1 and level 1:
x = ncread(url, 'hgt', [1 1 1 1], [Inf Inf 1 1]);
Best Answer